Compare the Squares

Here you need to carefully compare two similar-looking but different values. The function difference_of_squares receives number and calculates both the square of the sum of the first number natural numbers and the sum of their squares. Return the difference: the square of the sum minus the sum of the squares.

Примеры

Ввод
1
Вывод
0
Ввод
5
Вывод
170
Ввод
10
Вывод
2640

Нужно реализовать

def difference_of_squares(number: int) -> int:

Теги

math
PostgreSQLv16

Aquí aparecerá el resultado de la ejecución del código

Visible tests
1
Input
1
Expected0
2
Input
5
Expected170
3
Input
10
Expected2640
4
Input
100
Expected25164150
5
Input
0
Expected0
6
Input
2
Expected4
Focus radio
Paused · SomaFM · Fluid