Counting Palindromes
A
palindrome is a word, number, or phrase that reads the same forwards or backwards. For example, the phrases "Madam, I'm Adam" and "Poor Dan is in a droop" are palindromes. The numbers 743347 and 828 are also both palindromes.
Your challenge is to count how many numbers between zero and ten million are palindromes. The first ten are 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9 (any one digit number reads the same forwards or backwards). But 10 is
not a palindrome (even though you could write it as 010, we don't want to allow zero as a leading digit).
Happy counting!
Courtesy of Mark Nielsen