Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
nested for loop solution in Clear category for Count Consecutive Summers by t4d3uszk
def count_consecutive_summers(num):
# your code here
counter = 0
for i in range(1, num+1):
sum = 0
for j in range(i, num+1):
sum += j
if sum == num:
counter += 1
elif sum > num:
break
return counter
July 22, 2019