Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
is_integer() solution in Clear category for Count Consecutive Summers by flpo
def count_consecutive_summers(n):
max_seq = int(((8*n + 1)**0.5 - 1) / 2)
return sum(((n/(k+1) - k/2).is_integer() for k in range(max_seq)))
Dec. 11, 2018