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

Le résultat de l'exécution du code s'affichera ici

Tests12
Visible tests
Test caché 7
Test caché 8
Test caché 9
Test caché 10
Test caché 11
Test caché 12

They run when you press "Submit" — your whole solution is checked against them so you can't hard-code answers for the visible cases.

Focus radio
Paused · SomaFM · Fluid