866. Prime Palindrome
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n   public  static boolean isPalindrome(int x) {\n        if (x < 0 || (x % 10 == 0 && x != 0)) {\n            return false;\n        }\n        int r = 0;\n        while (x > r) {\n            r = r * 10 + x % 10;\n            x /= 10;\n        }\n        return x == r || x == r / 10;\n    }\n\n    public static  boolean isPrime(int x) {\n        if (x < 2) {\n            return false;\n        }\n        for (int i = 2; i * i <= x; i++) {\n            if (x % i == 0) {\n                return false;\n            }\n        }\n        return true;\n    }\n\n    public static  int primePalindrome(int n) {\n        while (true) {\n            if (n == reverse(n) && isPrime(n)) {\n                return n;\n            }\n            n++;\n            if (10_000_000 < n && n < 100_000_000) {\n                n = 100_000_000;\n            }\n        }\n    }\n\n    public static int reverse(int x) {\n        int r = 0;\n        while (x > 0) {\n            r = r * 10 + x % 10;\n            x /= 10;\n        }\n        return r;\n    }\n}\n\n    \n```
['Java']