479. Largest Palindrome Product Hard

@problem@discussion
#Math



1/**
2 * [479] Largest Palindrome Product
3 *
4 * 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.
5 *  
6 * Example 1:
7 * 
8 * Input: n = 2
9 * Output: 987
10 * Explanation: 99 x 91 = 9009, 9009 % 1337 = 987
11 * 
12 * Example 2:
13 * 
14 * Input: n = 1
15 * Output: 9
16 * 
17 *  
18 * Constraints:
19 * 
20 * 	1 <= n <= 8
21 * 
22 */
23pub struct Solution {}
24
25// problem: https://leetcode.com/problems/largest-palindrome-product/
26// discuss: https://leetcode.com/problems/largest-palindrome-product/discuss/?currentPage=1&orderBy=most_votes&query=
27
28// submission codes start here
29
30impl Solution {
31    pub fn largest_palindrome(n: i32) -> i32 {
32        0
33    }
34}
35
36// submission codes end
37
38#[cfg(test)]
39mod tests {
40    use super::*;
41
42    #[test]
43    fn test_479() {
44    }
45}
46


Back
© 2025 bowen.ge All Rights Reserved.