866. Prime Palindrome Medium
1/**
2 * [866] Prime Palindrome
3 *
4 * Given an integer n, return the smallest prime palindrome greater than or equal to n.
5 * An integer is prime if it has exactly two divisors: 1 and itself. Note that 1 is not a prime number.
6 *
7 * For example, 2, 3, 5, 7, 11, and 13 are all primes.
8 *
9 * An integer is a palindrome if it reads the same from left to right as it does from right to left.
10 *
11 * For example, 101 and 12321 are palindromes.
12 *
13 * The test cases are generated so that the answer always exists and is in the range [2, 2 * 10^8].
14 *
15 * Example 1:
16 * Input: n = 6
17 * Output: 7
18 * Example 2:
19 * Input: n = 8
20 * Output: 11
21 * Example 3:
22 * Input: n = 13
23 * Output: 101
24 *
25 * Constraints:
26 *
27 * 1 <= n <= 10^8
28 *
29 */
30pub struct Solution {}
31
32// problem: https://leetcode.com/problems/prime-palindrome/
33// discuss: https://leetcode.com/problems/prime-palindrome/discuss/?currentPage=1&orderBy=most_votes&query=
34
35// submission codes start here
36
37impl Solution {
38 pub fn prime_palindrome(n: i32) -> i32 {
39 0
40 }
41}
42
43// submission codes end
44
45#[cfg(test)]
46mod tests {
47 use super::*;
48
49 #[test]
50 fn test_866() {
51 }
52}
53
Back
© 2025 bowen.ge All Rights Reserved.