Palindrom question


im coding to guess nth palindrome number.

for example 12th palindrome number is 33

I have been tried to write the code to find next palindrome number

i used vector to represent palindrome number and guess next one

11211-> [1,1,2,1,1]

it work much better than brute force all the numbers to check its palindrome

im testing number up to 2*10^9

it work ok up to some 10^6 numbers but after that it become slow

anyone suggest other methods or fix my code to make it(much) faster?


Topic archived. No new replies allowed.