re: Project Euler #1 - Multiples of 3 and 5 VIEW POST

FULL DISCUSSION
 
def sum_natural_numbers_below_n(n):
    # O(N) complexity
    mult_3 = range(3, n, 3)
    mult_5 = range(5, n, 5)
    all_multiples = set(mult_3 + mult_5)
    return sum(all_multiples)

print(sum_natural_numbers_below_n(1000))
code of conduct - report abuse