479. Largest Palindrome Product 最大的回文产品

Find the largest palindrome made from the product of two n-digit numbers.

Since the result could be very large, you should return the largest palindrome mod 1337.

Example:

Input: 2

Output: 987

Explanation: 99 x 91 = 9009, 9009 % 1337 = 987

Note:

The range of n is [1,8].


  1. public class Solution {
  2. public int[] tab = {0, 9, 987, 123, 597, 677, 1218, 877, 475};
  3. public int LargestPalindrome(int n) {
  4. return tab[n];
  5. }
  6. }








原文地址:https://www.cnblogs.com/xiejunzhao/p/7912967.html