Change-making feasibility

Write codeEasy12 min

Your task

Smoothies cost exactly 5 dollars at a street stand. Customers pay one at a time, each with a single bill: a 5, a 10, or a 20 (given in order as bills). The stand opens with no cash and must give every customer exact change using bills collected so far. Return True if every customer can be served in order. Example: bills [5, 5, 10, 20] is True.

Examples

can_serve_all(bills: list[int]) -> bool
Example 1
Inputcan_serve_all([5, 5, 10, 20])
OutputTrue