I need a J2EE Developer
Budget: ₹100 – ₹400 INR
Min number of digits to be added to form Palindrome You need to find how many minimum no of digits need to be added to a given number input1, so that a palindrome could be formed by jumbling all the digits.
Example 1: If input1 6272, one digit (either '6' or '7) needs to be added so that a palindrome can be formed with the entire set of digits. So, the function should retum 1.
Example2: If input1 789, any two digits (either 7 and 8, or 7 and 9, or 8 and 9) need to be added so that a palindrome can be formed with the entire set of digits. So, the function should return 2.
Example3: If input1 - 68, any one digit (6 or 8) need to be added to form a palindrome. So, the function should return 1.
Example4: If input1= 110, zero digits need to be added, because all the existing digits can already form a palindrome. So, the function should return 0.
Example5: If input1= 6, zero digits need to be added, because 6 is already a single-digit palindrome. So, the function should return 0.
Note
1) You are NOT expected to return the palindrome. You are only expected to find the "number of digits to be added" to the given number so that a palindrome could be formed with the entire set of digits 2) Please note that within this assignment's scope, single digits should also be considered as palindromes ie. numbers 0 to 9 are palindromes. This is illustrated in Examples 5 above.
Example 1: If input1 6272, one digit (either '6' or '7) needs to be added so that a palindrome can be formed with the entire set of digits. So, the function should retum 1.
Example2: If input1 789, any two digits (either 7 and 8, or 7 and 9, or 8 and 9) need to be added so that a palindrome can be formed with the entire set of digits. So, the function should return 2.
Example3: If input1 - 68, any one digit (6 or 8) need to be added to form a palindrome. So, the function should return 1.
Example4: If input1= 110, zero digits need to be added, because all the existing digits can already form a palindrome. So, the function should return 0.
Example5: If input1= 6, zero digits need to be added, because 6 is already a single-digit palindrome. So, the function should return 0.
Note
1) You are NOT expected to return the palindrome. You are only expected to find the "number of digits to be added" to the given number so that a palindrome could be formed with the entire set of digits 2) Please note that within this assignment's scope, single digits should also be considered as palindromes ie. numbers 0 to 9 are palindromes. This is illustrated in Examples 5 above.
Related categories:
Business, Accounting, Human Resources & Legal
JSP
J2EE
Software Architecture
Hadoop