Fun
Only logged in members can reply and interact with the post.
Join SimilarWorlds for FREE »

93539 is an example of a palindrome (If one reads it from left to right or right to left, it is the same). From, 100-1000, how many of these exist? [I Love Maths]

Please show your working. No cheating.
This page is a permanent link to the reply below and its nested replies. See all post replies »
DDonde · 31-35, M
for i is 100 to 1000
For each digit left of middle, push to stack
If it's odd length, ignore the middle digit
For every digit after middle, check to see if it matches the top of the stack and pop it if it does. If there is a mismatch, it's not a palindrome. Or if the stack is not empty at the end, it is not a palindrome.
If it the stack is empty by the end, add 1 to the count of palindromes.

Clear the stack. Next number.