866. Prime Palindrome c++ innovative sol
\nclass Solution {\npublic:\n    int primePalindrome(int N) {\n        if(N <= 2) return 2;\n        if(N>7 && N<=11) return 11;\n        for(int i = 1; i < 999
```\nclass Solution {\npublic:\n    int primePalindrome(int N) {\n        if(N <= 2) return 2;\n        if(N>7 && N<=11) return 11;\n        for(int i = 1; i < 999999; i++){\n            auto palin = palinize(i);\n            if(palin >= N && isPrime(palin)) return palin;\n        }        \n        return 0;\n    }\n    \n    int palinize(int x){\n        auto s = to_string(x), t = s;\n        reverse(t.begin(), t.end());\n        s.pop_back();\n        return stoi(s+t);\n    }\n    \n    bool isPrime(int x){\n        if(x%2==0) return false;\n        int sq = int(sqrt(x)) + 1;\n        for(int i = 3; i<=sq; i+= 2)\n            if(x % i == 0) return false;\n        return true;\n    }\n};\n```
[]