Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Count Consecutive Summers by Tinus_Trotyl
def count_consecutive_summers(num):
consecutives = 1
for lo in range(1, num // 2 + 1):
for hi in range(lo + 1 , num // 2 + num % 2 + 1):
if not num == sum(range(lo, hi + 1)): continue
consecutives += 1
break
return consecutives
March 23, 2019