Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Feed Pigeons by tomkun
def checkio(food):
num_pidgeons = 0
fed = 0
i=0
while True:
num_pidgeons = sum(range(i+1))
i+=1
if food > fed:
fed = min(num_pidgeons, food)
food-=num_pidgeons
else:
return fed
Feb. 23, 2015