Given an integer n, return the smallest number that is both prime and a palindrome and is greater than or equal to n.
• A prime number has exactly two divisors: 1 and itself.
Examples: 2, 3, 5, 7, 11.
• A palindrome reads the same forwards and backwards.
Examples: 121, 1331.
The answer will always exist within the range [2, 2 * 10^8].
Input: n = 6
Output: 7
Explanation:
The next prime palindrome after 6 is 7.
Input: n = 8
Output: 11
Explanation:
The next prime palindrome after 8 is 11.
Input: n = 13
Output: 101
Explanation:
The next prime palindrome after 13 is 101.
Accepted:
Submission: