feat(content): function signatures + test cases
This commit is contained in:
@@ -9,6 +9,28 @@ categories:
|
||||
patterns:
|
||||
- monotonic-stack
|
||||
|
||||
function_signature: "def cal_points(operations: list[str]) -> int:"
|
||||
|
||||
test_cases:
|
||||
visible:
|
||||
- input: { operations: ["5", "2", "C", "D", "+"] }
|
||||
expected: 30
|
||||
- input: { operations: ["5", "-2", "4", "C", "D", "9", "+", "+"] }
|
||||
expected: 27
|
||||
- input: { operations: ["1", "C"] }
|
||||
expected: 0
|
||||
hidden:
|
||||
- input: { operations: ["1"] }
|
||||
expected: 1
|
||||
- input: { operations: ["5", "10", "+"] }
|
||||
expected: 30
|
||||
- input: { operations: ["3", "D", "D", "D"] }
|
||||
expected: 45
|
||||
- input: { operations: ["-5", "10", "+", "D"] }
|
||||
expected: 20
|
||||
- input: { operations: ["1", "2", "3", "4", "5"] }
|
||||
expected: 15
|
||||
|
||||
description: |
|
||||
You are keeping the scores for a baseball game with strange rules. At the beginning of the game, you start with an empty record.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user