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```java []\nclass Solution {\n    private boolean isPrime(int x) {\n        if (x < 2) return false;\n        for (int i = 2; i * i <= x; i++) {\n            if (x % i == 0) return false;\n        }\n        return true;\n    }\n\n    private boolean isPalindrome(int x) {\n        String str = Integer.toString(x);\n        int left = 0, right = str.length() - 1;\n        while (left < right) {\n            if (str.charAt(left) != str.charAt(right)) return false;\n            left++;\n            right--;\n        }\n        return true;\n    }\n\n    public int primePalindrome(int n) {\n        if (n <= 2) return 2;\n        int x = n;\n        while (true) {\n            if (isPalindrome(x) && isPrime(x)) {\n                return x;\n            }\n            x++;\n            if (10_000_000 < x && x < 100_000_000) {\n                x = 100_000_000;\n            }\n        }\n    }\n}\n\n```
['Java']