Skip to content

Commit 78849a7

Browse files
authored
Update sum_of_squares.py
1 parent 37c0953 commit 78849a7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

maths/sum_of_squares.py

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
The function takes an integer n as input and returns the sum of squares
55
from 1 to n using the formula n(n + 1)(2n + 1) / 6. This formula computes the sum efficiently
66
without the need for iteration.
7+
8+
https://www.cuemath.com/algebra/sum-of-squares/
79
"""
810

911
def sum_of_squares(n: int) -> int:

0 commit comments

Comments
 (0)