Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Feed Pigeons by radekj
from collections import defaultdict
def checkio(food):
minute = pigeons = 0
fed_pigeons = defaultdict(int)
while food:
minute += 1
pigeons += minute
# feed pigeons
for pigeon in range(pigeons):
if food:
food -= 1
fed_pigeons[pigeon] += 1
return len(fed_pigeons)
April 8, 2015
Comments: