@@ -0,0 +1,1199 @@
+# Time:  O(n%5E(3/2))%0A# Space: O(logn)%0A%0A# Find the smallest prime palindrome greater than or equal to N.%0A# Recall that a number is prime if it's only divisors are 1 and itself,%0A# and it is greater than 1.%0A#%0A# For example, 2,3,5,7,11 and 13 are primes.%0A#%0A# Recall that a number is a palindrome if it reads the same from%0A# left to right as it does from right to left.%0A#%0A# For example, 12321 is a palindrome.%0A#%0A# Example 1:%0A#%0A# Input: 6%0A# Output: 7%0A# Example 2:%0A#%0A# Input: 8%0A# Output: 11%0A# Example 3:%0A#%0A# Input: 13%0A# Output: 101%0A#%0A# Note:%0A# - 1 %3C= N %3C= 10%5E8%0A# - The answer is guaranteed to exist and be less than 2 * 10%5E8.%0A%0Atry:%0A    xrange          # Python 2%0Aexcept NameError:%0A    xrange = range  # Python 3%0A%0A%0Aclass Solution(object):%0A    def primePalindrome(self, N):%0A        %22%22%22%0A        :type N: int%0A        :rtype: int%0A        %22%22%22%0A        def is_prime(n):%0A            if n %3C 2 or n %25 2 == 0:%0A                return n == 2%0A            return all(n %25 d for d in xrange(3, int(n**.5) + 1, 2))%0A%0A        if 8 %3C= N %3C= 11:%0A            return 11%0A        for i in xrange(10**(len(str(N))//2), 10**5):%0A            j = int(str(i) + str(i)%5B-2::-1%5D)%0A            if j %3E= N and is_prime(j):%0A                return j%0A

Create prime-palindrome.py