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