Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Uncategorized category for Feed Pigeons by capback250
def checkio(food):
minute = 0
fed_pigeons = 0
pigeons = 0
while True:
minute += 1
old_pigeons = pigeons
pigeons += minute
if food < pigeons:
remains_food = food - old_pigeons
if remains_food > 0:
fed_pigeons += remains_food
break
else:
food -= pigeons
fed_pigeons += minute
return fed_pigeons
Feb. 9, 2016