feat(content): function signatures + test cases

This commit is contained in:
2025-07-13 19:53:34 +01:00
parent 9e6c6d256f
commit 65a8d525f5
203 changed files with 4526 additions and 0 deletions

View File

@@ -8,6 +8,28 @@ categories:
patterns:
- greedy
function_signature: "def lemonade_change(bills: list[int]) -> bool:"
test_cases:
visible:
- input: { bills: [5, 5, 5, 10, 20] }
expected: true
- input: { bills: [5, 5, 10, 10, 20] }
expected: false
hidden:
- input: { bills: [5] }
expected: true
- input: { bills: [10] }
expected: false
- input: { bills: [5, 5, 10] }
expected: true
- input: { bills: [5, 5, 5, 5, 20, 20] }
expected: true
- input: { bills: [5, 5, 5, 10, 5, 20, 5, 10, 5, 20] }
expected: true
- input: { bills: [5, 5, 10, 20, 5, 5, 5, 5, 5, 5, 5, 5, 5, 10, 5, 5, 20, 5, 20, 5] }
expected: true
description: |
At a lemonade stand, each lemonade costs `$5`. Customers are standing in a queue to buy from you and order one at a time (in the order specified by `bills`). Each customer will only buy one lemonade and pay with either a `$5`, `$10`, or `$20` bill. You must provide the correct change to each customer so that the net transaction is that the customer pays `$5`.