860. Lemonade Change

Practice Lemonade Change for free on NudgeCode: Easy, Greedy pattern. Write it in Python or JavaScript, run the tests in your browser, and ask for a hint when you are stuck.

Each lemonade costs $5. Customers line up and pay in order, each with a single bill from bills (5, 10 or 20). You start with no money. Return true if you can give every customer the correct change, otherwise false.

Example

bills = [5,5,5,10,20]  ->  true
bills = [5,5,10,10,20] ->  false

Constraints