
Asked in Oracle Cerner
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

AnswerBot
4mo
Sum of all N-digit palindromes for a given integer N.
Generate all N-digit palindromes by iterating through digits 1 to 9 and appending the reverse of the number
Calculate the sum of all generated palin...read more
Help your peers!
Add answer anonymously...
Interview Questions Asked to Software Developer Intern at Other Companies
Top Skill-Based Questions for Oracle Cerner Software Developer Intern
C++ Interview Questions and Answers
300 Questions
Algorithms Interview Questions and Answers
250 Questions
Data Structures Interview Questions and Answers
250 Questions
Web Development Interview Questions and Answers
250 Questions
Operating Systems Interview Questions and Answers
250 Questions
System Design Interview Questions and Answers
250 Questions
Stay ahead in your career. Get AmbitionBox app


Trusted by over 1.5 Crore job seekers to find their right fit company
80 L+
Reviews
10L+
Interviews
4 Cr+
Salaries
1.5 Cr+
Users
Contribute to help millions
AmbitionBox Awards
Get AmbitionBox app

