Task:
Calculate the number of points with integer coordinates that fall into a circle of radius n.
I decided it this way:
def points(n): count = 0 for i in range(-n, n + 1): for j in range(-n, n + 1): if i * i + j * j <= n * n: count += 1 return count But this code slows down, and the online check gives a timeout. How can you speed up this code? Maybe through the library? In the local IDE (PyCharm) it also slows down.