Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Simple circle function solution in Clear category for Counting Tiles by mindaugas.dadurkevicius
def checkio(r):
MAX_R = 4
full_sq, part_sq = 0, 0
for x in range(MAX_R):
for y in range(MAX_R):
if (x+1)**2 + (y+1)**2 <= r**2:
full_sq += 1
elif x**2 + y**2 < r**2:
part_sq += 1
return [full_sq * 4, part_sq * 4]
June 21, 2021
Comments: