feat(content): more test cases

This commit is contained in:
2025-07-13 19:25:39 +01:00
parent e28da5def2
commit 0f264ef603
94 changed files with 1840 additions and 0 deletions

View File

@@ -10,6 +10,26 @@ categories:
patterns:
- monotonic-stack
function_signature: "def calculate(s: str) -> int:"
test_cases:
visible:
- input: { s: "3+2*2" }
expected: 7
- input: { s: " 3/2 " }
expected: 1
- input: { s: " 3+5 / 2 " }
expected: 5
hidden:
- input: { s: "42" }
expected: 42
- input: { s: "1+1+1" }
expected: 3
- input: { s: "2*3*4" }
expected: 24
- input: { s: "14-3/2" }
expected: 13
description: |
Given a string `s` which represents an expression, *evaluate this expression and return its value*.