🔥Easy Solution -> Full beginner friendly 💯
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\nWe can divide it into 4 parts:-\n    1.Find if the number is palindrome o
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\nWe can divide it into 4 parts:-\n    1.Find if the number is palindrome or not.\n    2.Find if the number is prime or not.\n    3.If it satisfy both prime and palindrome than we return n.\n    4.Else while(true) -> If n satisfy both prime and Palindrome -> return n. Else -> n++.\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity: O(n)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: O(n)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\nPlssssss Up Vote! -> \uD83D\uDE2D\n# Code\n```\nclass Solution {\n    public static boolean isPalindrome(int x) {\n        int r,s=0,c=x;\n        while(x>0){\n            r=x%10;\n            s=(s*10)+r;\n            x = x/10;\n        }\n        if(c==s) return true; \n        else return false;\n    }\n    public static boolean isPrime(int num){\n        boolean isPrime = true;\n        if (num < 2) isPrime = false;\n        else for (int i = 2; i <= Math.sqrt(num); i++) \n               if (num % i == 0) {\n                    isPrime = false;\n                    break;\n                }\n        if (isPrime) return true;\n        else return false;\n    }\n    public int primePalindrome(int n) {\n        if(isPrime(n) && isPalindrome(n)) return n;\n        else{\n            while(true){\n                if(isPrime(n) && isPalindrome(n)) return n;\n                n++;\n                if (10_000_000 < n && n < 100_000_000) n = 100_000_000;\n            }\n        }\n    }\n}\n```
['Java']