Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
While loop solution in Clear category for Feed Pigeons by Striga
def checkio(number):
minute, birds = 0, 0
while number > birds:
minute += 1
birds += minute
number -= birds
return birds if number > 0 else birds + number
if __name__ == '__main__':
assert checkio(1) == 1, "1st example"
assert checkio(2) == 1, "2nd example"
assert checkio(5) == 3, "3rd example"
assert checkio(10) == 6, "4th example"
Dec. 7, 2020