381 B
381 B
The trick here is that we only need to test 1998 numbers. Because there are only so much base10 palindromes:
- The numbers from
1to999mirrored result into to palindromes11to999999 - The numbers from
1to999mirrored at the last digit result into to palindromes1to99999
Then we only need to test these numbers whether they are also binary palindromes.