n
is 1, return 9 as the largest palindrome.hi
) and lowest (lo
) n
-digit numbers.hi
to lo
in a descending order:
a. Convert the current number i
to a string s
.
b. Create a palindromic string by appending the reverse of s
to s
itself.
c. Convert the palindromic string back to an integer ll
.ll
, iterate from hi
to the square root of ll
:
a. Check if ll
is divisible by the current number j
.
b. If it is, and the quotient is also an n
-digit number, return ll
modulo 1337.