{"ScriptPreparationCode":null,"TestCases":[{"Name":"Prime1","Code":"var primePalindrome = function(n) {\r\n \r\n while (true){\r\n let str = String(n)\r\n if (str.length % 2 == 0 \u0026\u0026 n \u003E 11){\r\n n = 1 \u002B Array(str.length).fill(0).join(\u0022\u0022)\r\n continue\r\n }\r\n if (!isPalindrome(str)) {\r\n n\u002B\u002B\r\n continue\r\n }\r\n if (isPrime(n)) return n\r\n n\u002B\u002B\r\n }\r\n \r\n};\r\n\r\nfunction isPrime(n){\r\n if (n \u003C= 1) return false\r\n if (n \u003C= 3) return true\r\n if (n % 2 == 0 || n % 3 == 0) return false\r\n \r\n for (let i = 3; i \u003C= Math.floor(Math.sqrt(n)) \u002B 1;i\u002B=2){\r\n if (n % i == 0) return false \r\n }\r\n return true\r\n}\r\n\r\nfunction isPalindrome(str){\r\n let l = 0, r = str.length-1\r\n while (l \u003C r){\r\n if (str[l] != str[r]) return false\r\n l\u002B\u002B\r\n r--\r\n }\r\n return true\r\n}\r\n\r\nprimePalindrome(51633903)","IsDeferred":false},{"Name":"Prim22pow","Code":"var primePalindrome = function(n) {\r\n \r\n while (true){\r\n let str = String(n)\r\n if (str.length % 2 == 0 \u0026\u0026 n \u003E 11){\r\n n = Math.pow(10, Math.ceil(Math.log10(n\u002B1)))\r\n \r\n continue\r\n }\r\n if (!isPalindrome(str)) {\r\n n\u002B\u002B\r\n continue\r\n }\r\n if (isPrime(n)) return n\r\n n\u002B\u002B\r\n }\r\n \r\n};\r\n\r\nfunction isPrime(n){\r\n if (n \u003C= 1) return false\r\n if (n \u003C= 3) return true\r\n if (n % 2 == 0 || n % 3 == 0) return false\r\n \r\n for (let i = 3; i \u003C= Math.floor(Math.sqrt(n)) \u002B 1;i\u002B=2){\r\n if (n % i == 0) return false \r\n }\r\n return true\r\n}\r\n\r\nfunction isPalindrome(str){\r\n let l = 0, r = str.length-1\r\n while (l \u003C r){\r\n if (str[l] != str[r]) return false\r\n l\u002B\u002B\r\n r--\r\n }\r\n return true\r\n}\r\n\r\nprimePalindrome(51633903)","IsDeferred":false}]}