Largest Palindrome Product

Given an integer n, return the largest palindromic integer that can be represented as the product of two n-digit integers. Since the answer can be very large, return it modulo 1337.

Example 1
Inputn = 2
Output987
99 x 91 = 9009, and 9009 % 1337 = 987.
Example 2
Inputn = 1
Output9
The largest palindromic product of two 1-digit integers is 9.

Constraints

  • 1 <= n <= 8

Asked at 1 companies

</>

Your Solution

(Ctrl/Cmd + Enter)

Switching Language

Loading template...

Loading...

Sign in to save your progress

AI code evaluation

Get a correctness verdict, missed edge cases, and complexity analysis of your solution.

Sign in to evaluate