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

@@ -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.