Given an integer D, the task is to find all the D-digit palindrome numbers.
Input: D = 1
Output: 1 2 3 4 5 6 7 8 9
Input: D = 2
Output: 11 22 33 44 55 66 77 88 99
Approach: Numbers with D-digits start from 10(D – 1) to 10D – 1. So, start checking every number from this interval whether it is palindrome or not.
Below is the implementation of the above approach:
11 22 33 44 55 66 77 88 99
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Count the number of digits of palindrome numbers in an array
- Find the numbers from 1 to N that contains exactly k non-zero digits
- Find all the prime numbers of given number of digits
- Find all Autobiographical Numbers with given number of digits
- Find the total count of numbers up to N digits in a given base B
- Find maximum product of digits among numbers less than or equal to N
- Find N numbers such that a number and its reverse are divisible by sum of its digits
- Find the count of numbers that can be formed using digits 3, 4 only and having length at max N.
- Find all the possible numbers in a range that can be evenly divided by its digits
- N'th palindrome of K digits
- Check if the sum of digits of N is palindrome
- Smallest and Largest Palindrome with N Digits
- Make largest palindrome by changing at most K-digits
- Count of numbers upto N digits formed using digits 0 to K-1 without any adjacent 0s
- Count of numbers between range having only non-zero digits whose sum of digits is N and number is divisible by M
- Count numbers in given range such that sum of even digits is greater than sum of odd digits
- Numbers with sum of digits equal to the sum of digits of its all prime factor
- Numbers of Length N having digits A and B and whose sum of digits contain only digits A and B
- Find the average of k digits from the beginning and l digits from the end of the given number
- Sum of all N digit palindrome numbers
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.