Beginner Friendly Solution || Easy to understand
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 {\npublic:\n    bool isPrime(int x) {\n        if (x <= 1) return false;\n        if (x == 2) return true;\n        if (x % 2 == 0) return false;\n        for (int i = 3; i * i <= x; i += 2) {\n            if (x % i == 0) return false;\n        }\n        return true;\n    }\n\n    bool isPalindrome(int x) {\n        if (x < 0) return false;\n        int rev = 0, t = x;\n        while (t != 0) {\n            int r = t % 10;\n            rev = rev * 10 + r;\n            t /= 10;\n        }\n        return rev == x;\n    }\n\n    int primePalindrome(int n) {\n        if (n <= 2) return 2;\n        if (n % 2 == 0) ++n;\n        for (int i = n; ; i += 2) {\n            if (isPalindrome(i) && isPrime(i)) {\n                return i;\n            }\n        }\n    }\n};\n\n```
['C++']