Sum Special Multiples

Imagine you need to quickly add all numbers below a boundary that are divisible by 3 or 5. Write solution, which receives n and returns the sum of all natural numbers less than n that are multiples of 3 or 5. If n is negative, return 0.

Примеры

Ввод
10
Вывод
23
Ввод
0
Вывод
0
Ввод
20
Вывод
78

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

def solution(n: int) -> int:

Теги

math
PostgreSQLv16

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

Visible tests
1
Input
10
Expected23
2
Input
0
Expected0
3
Input
20
Expected78
4
Input
200
Expected9168
5
Input
-5
Expected0
6
Input
2
Expected0
Focus radio
Paused · SomaFM · Fluid