Everybody loves **pi**, but what if **pi** were a square? Given a number of digits ```digits```, find the smallest integer whose square is greater or equal to the sum of the squares of the first ```digits``` digits of pi, including the ```3``` before the decimal point.

**Note:** Test cases will not extend beyond 100 digits; the first 100 digits of pi are pasted here for your convenience:
```
31415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679
```


## Examples

```
digits   = 1   #  [3]
expected = 3   #  sqrt(3^2) = 3


digits   = 3   #  [3, 1, 4]
expected = 6   #  sqrt(3^2 + 1^2 + 4^2) = 5.099 --> 6
```

Difficulty: introductory

Starter code:

def square_pi(digits):
	

Solutions:
from math import ceil

PI_DIGITS_SQUARED = [int(d)**2 for d in "31415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679"]

def square_pi(n):
    return ceil(sum(PI_DIGITS_SQUARED[:n])**0.5)

square_pi = (0, 3, 4, 6, 6, 8, 12, 12, 14, 15, 15, 16, 18, 20, 21, 23, 23, 23, 23, 25, 25, 26, 26, 27, 27, 27, 27, 28, 29, 29, 30, 31, 31, 31, 31, 32, 33, 34, 34, 35, 36, 36, 36, 37, 37, 38, 39, 40, 40, 41, 41, 41, 41, 42, 42, 42, 43, 43, 43, 44, 45, 45, 45, 46, 46, 46, 46, 47, 47, 47, 48, 48, 48, 48, 48, 49, 49, 49, 49, 50, 51, 52, 52, 53, 53, 53, 53, 53, 53, 54, 54, 54, 54, 55, 55, 55, 55, 55, 55, 55, 56).__getitem__


from math import ceil

pi_digits = "31415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679"

def square_pi(digits):
  return ceil(sum(int(d)**2 for d in pi_digits[:digits])**0.5)

import math

pi_digits = '31415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679'

def square_pi(digits):
    s = sum(d*d for d in map(int, pi_digits[:digits]))
    return math.ceil(s ** 0.5)

from math import ceil
from itertools import accumulate

digs = map(int,'031415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679')
MEMO = tuple( ceil(s**.5) for s in accumulate(d*d for d in digs))
square_pi = MEMO.__getitem__

from math import ceil, sqrt
def square_pi(digits):
    pi = '31415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679'
    return ceil(sqrt(sum(int(i)**2 for i in pi[:digits])))
    


from math import ceil

cache = [int(d)**2 for d in "31415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679"]

def square_pi(n):
    return ceil(sum(cache[:n])**0.5)

def square_pi(digits):
  return __import__('math').ceil(sum(int(i) ** 2 for i in '31415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679'[:digits]) ** 0.5)

from math import ceil

pi = "31415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679"

def square_pi(digits):  
  return ceil(sum(int(d)**2 for d in pi[:digits])**0.5)

PI = 31415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679
def square_pi(digits):
    n = 100 - digits + 1
    num = PI // 10**n
    sum = 0
    while num:
        num, m = divmod(num, 10)
        sum += m**2
    i = 0
    while True:
        if i**2 >= sum:
            return i
        i += 1