Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Feed Pigeons by evarome10
def checkio(food):
new_pidgeons, fed_pigeons = 0, 0
while True:
new_pidgeons += 1
total_pidgeons = fed_pigeons + new_pidgeons
if food < total_pidgeons:
return max(fed_pigeons, food)
else:
food -= total_pidgeons
fed_pigeons += new_pidgeons
Nov. 16, 2018