Given an integer N the task is to create a string out of it by repeating the number such that the length of the resultant string is equal to the sum of the digits in the original number.
For eg: If the number is 61 and the sum of the digits is 6 + 1 = 7 so the string generated after repeating 61 will be of 7 length i.e. 6161616.
Input: N = 10101
Length of the string is given by sum of the digits i.e. 1 + 0 + 1 + 0 + 1 = 3.
So the resultant string is “101” which is a palindrome.
Input: N = 123
Length of the string will be 1 + 2 3 = 6.
So the resultant string is “123123” which is not a palindrome.
- Find the sum of the digits of N and repeat the number till the length of the string becomes equal to this sum.
- Now check if the resultant string is a palindrome or not.
- If it is a palindrome then print Yes.
- Else print No.
Below is the implementation of the above approach:
- Check if a number is Palindrome in PL/SQL
- Check if a number is Palindrome
- Program to check the number is Palindrome or not
- Check if number is palindrome or not in Octal
- Bash program to check if the Number is a Palindrome
- To check a number is palindrome or not without using any extra space
- Recursive program to check if number is palindrome or not
- Check if a number with even number of digits is palindrome or not
- Check if actual binary representation of a number is palindrome
- Largest even number possible by using one swap operation in given number
- C Program to Check if a Given String is Palindrome
- Check if a given string is a rotation of a palindrome
- Check if a string is palindrome in C using pointers
- Check if it is possible to create a palindrome string from given N
- Check if any anagram of a string is palindrome or not