feat(content): function signatures + test cases
This commit is contained in:
@@ -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`.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user