A lemonade costs 5. Customers queue up and each pays with a bill of 5, 10 or 20, buying one lemonade. You start with no money, so you must give change from the bills you collected. Return True if you can give the correct change to every customer in order.
For [5, 5, 5, 10, 20] the answer is True; for [5, 5, 10, 10, 20] it is False.
Example 1
Input:
lemonade_change([5, 5, 5, 10, 20])
Output:
True
Example 2
Input:
lemonade_change([5, 5, 10, 10, 20])
Output:
False
0 <= len(bills) <= 200000No results yet
Run your code to check it against the examples, or submit to run every test.