Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Counting tiles solution in Uncategorized category for Counting Tiles by capback250
import math
def checkio(r):
inner = 0
outer = 0
for y in range(1, int(math.ceil(r))+1):
for x in range(1, int(math.ceil(r))+1):
if math.hypot(x,y) < r:
inner += 1
for y in range(int(math.ceil(r))+1):
for x in range(int(math.ceil(r))+1):
if math.hypot(x,y) < r and math.hypot(x+1,y+1) > r:
outer += 1
return [4*inner, 4*outer]
Sept. 9, 2015