feat(content): more test cases
This commit is contained in:
@@ -8,6 +8,30 @@ categories:
|
||||
patterns:
|
||||
- greedy
|
||||
|
||||
function_signature: "def candy(ratings: list[int]) -> int:"
|
||||
|
||||
test_cases:
|
||||
visible:
|
||||
- input: { ratings: [1, 0, 2] }
|
||||
expected: 5
|
||||
- input: { ratings: [1, 2, 2] }
|
||||
expected: 4
|
||||
hidden:
|
||||
- input: { ratings: [1] }
|
||||
expected: 1
|
||||
- input: { ratings: [1, 2, 3, 4, 5] }
|
||||
expected: 15
|
||||
- input: { ratings: [5, 4, 3, 2, 1] }
|
||||
expected: 15
|
||||
- input: { ratings: [1, 3, 2, 2, 1] }
|
||||
expected: 7
|
||||
- input: { ratings: [1, 2, 3, 1, 0] }
|
||||
expected: 9
|
||||
- input: { ratings: [1, 3, 4, 5, 2] }
|
||||
expected: 11
|
||||
- input: { ratings: [1, 1, 1, 1] }
|
||||
expected: 4
|
||||
|
||||
description: |
|
||||
There are `n` children standing in a line. Each child is assigned a rating value given in the integer array `ratings`.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user