Set by Tom Smith and Michael Cronnelly
- JavaScript
- PHP
- Java
- C#
- Ruby
- Python,
Some positive integers n have the property that the sum of (n + reverse(n)) consists entirely of odd digits.
For instance:
When n = 36 then 36 + 63 = 99
When n = 409 then 409 + 904 = 1313
We will call such numbers reversible; so 36, 63, 409, and 904 are reversible.
If the reverse of n has a leading zero then n is not considered reversible.
For instance:
10 + 01 is ignored and 10 is not
There are 120 reversible numbers below 1000.
Develop a solution that can take any integer as an upper limit and returns all the reversible numbers from 1 to the upper limit, as an array.