Easy CPP Solution
Intuition\nBrute-force approach, but we efficiently reduces the number of checks by focusing only on palindrome candidates and skipping non-palindrome numbers.\
# Intuition\nBrute-force approach, but we efficiently reduces the number of checks by focusing only on palindrome candidates and skipping non-palindrome numbers.\n\n# Code\n```cpp []\nclass Solution{\npublic:\n    int primePalindrome(int n){\n        if (8 <= n && n <= 11) return 11;\n        for (int x = pow(10, (int)log10(n) / 2); x < 100000; ++x){\n            string s = to_string(x);\n            string r(s.rbegin() + 1, s.rend());\n            int y = stoi(s + r);\n            if (y >= n && is_prime(y)){\n                return y;\n            }\n        }\n        return -1;\n    }\n    bool is_prime(int num){\n        if (num < 2) return false;\n        if (num == 2 || num == 3) return true;\n        if (num % 2 == 0 || num % 3 == 0) return false;\n        for (int i = 5; i * i <= num; i += 6){\n            if (num % i == 0 || num % (i + 2) == 0) return false;\n        }\n        return true;\n    }\n    bool is_palindrome(int num){\n        string s = to_string(num);\n        int n = s.length();\n        for (int i = 0; i < n / 2; i++)\n            if (s[i] != s[n - 1 - i]) return false;\n        return true;\n    }\n};\n```
['C++']