Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Feed Pigeons by Happiness
def checkio(portions):
n = 1
pigeons = 1
while portions >= pigeons:
portions -= pigeons
n += 1
pigeons += n
if portions > (pigeons - n):
return portions
else:
return pigeons - n
Feb. 14, 2015
Comments: