Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Feed Pigeons solution in Uncategorized category for Feed Pigeons by Aleksandra_Niewiadomska
def checkio(food: int) -> int:
total_arrived = 0
daily_arrival = 1
while food >= total_arrived + daily_arrival:
total_arrived, food = total_arrived + daily_arrival, food - (total_arrived + daily_arrival)
daily_arrival += 1
return max(food, total_arrived)
print("Example:")
print(checkio(5))
# These "asserts" are used for self-checking
assert checkio(1) == 1
assert checkio(3) == 2
assert checkio(5) == 3
assert checkio(10) == 6
print("The mission is done! Click 'Check Solution' to earn rewards!")
Feb. 1, 2023