width digits (no leading zeros), and multiply them. Among all such products, find the largest one that is a palindrome, meaning it reads the same forwards and backwards.
The number can be huge, so return it modulo 1337.width=2 → 987
The largest palindrome is 9009 = 99 · 91, and 9009 mod 1337 is 987.
width=1 → 9
With one-digit factors the best palindrome is 9 = 1 · 9 (or 3 · 3).
width=3 → 123
width=2
987
Run checks the first 3 tests in your browser. Submit checks all 11 tests on the server, hidden ones included.