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
Entre para ver seu histórico de envios
EntrarEntre para usar o AI Mentor
EntrarVisible tests
1
Input
10Expected
232
Input
0Expected
03
Input
20Expected
784
Input
200Expected
91685
Input
-5Expected
06
Input
2Expected
0Focus radio
Paused · SomaFM · Fluid