Skip to content

Files

Latest commit

author
Shuo
Nov 27, 2021
cb30580 · Nov 27, 2021

History

History

largest-palindrome-product

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Nov 27, 2021
Nov 12, 2019
Nov 12, 2019

< Previous                  Next >

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

 

Example 1:

Input: n = 2
Output: 987
Explanation: 99 x 91 = 9009, 9009 % 1337 = 987

Example 2:

Input: n = 1
Output: 9

 

Constraints:

  • 1 <= n <= 8

Related Topics

[Math]