Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Brutish force solution in Clear category for Count Consecutive Summers by evrur97
def count_consecutive_summers(num):
count = 0
for start in range(1,num + 1):
for end in range(start, num + 1):
test_sum = sum(range(start, end + 1))
if test_sum == num:
count += 1
elif test_sum < num:
continue
break
return count
Aug. 1, 2019