Sum of N-Digit Palindromes
Determine the sum of all N-digit palindromes for a given integer 'N'. A palindrome is defined as a number that remains the same when its digits are reversed.
Example:
Input:
T = 1
N = 1
Output:
45
Explanation:
For N = 1, the numbers are [1, 2, 3, 4, 5, 6, 7, 8, 9, 0] and all are palindromes. Their sum is 45.
Constraints:
1 ≤ T ≤ 50
1 ≤ N ≤ 12
- Time Limit: 1 sec
Be the first one to answer
Add answer anonymously...
Popular interview questions of Software Developer Intern
>
Oracle Cerner Software Developer Intern Interview Questions
Stay ahead in your career. Get AmbitionBox app
Helping over 1 Crore job seekers every month in choosing their right fit company
65 L+
Reviews
4 L+
Interviews
4 Cr+
Salaries
1 Cr+
Users/Month
Contribute to help millions
Get AmbitionBox app