feat(content): hidden test cases

This commit is contained in:
2025-08-06 23:21:42 +01:00
parent 8544efb5bf
commit e0bf8cda01
134 changed files with 2075 additions and 0 deletions

View File

@@ -8,6 +8,32 @@ categories:
patterns:
- monotonic-stack
function_signature: "class MinStack"
test_cases:
visible:
- input:
operations: ["MinStack", "push", "push", "push", "getMin", "pop", "top", "getMin"]
args: [[], [-2], [0], [-3], [], [], [], []]
expected: [null, null, null, null, -3, null, 0, -2]
- input:
operations: ["MinStack", "push", "push", "getMin", "pop", "getMin"]
args: [[], [1], [2], [], [], []]
expected: [null, null, null, 1, null, 1]
hidden:
- input:
operations: ["MinStack", "push", "push", "push", "top", "pop", "getMin", "pop", "getMin", "pop", "push", "top", "getMin", "push", "top", "getMin", "pop", "getMin"]
args: [[], [2147483646], [2147483646], [2147483647], [], [], [], [], [], [], [2147483647], [], [], [-2147483648], [], [], [], []]
expected: [null, null, null, null, 2147483647, null, 2147483646, null, 2147483646, null, null, 2147483647, 2147483647, null, -2147483648, -2147483648, null, 2147483647]
- input:
operations: ["MinStack", "push", "push", "push", "getMin", "top", "pop", "getMin"]
args: [[], [0], [1], [0], [], [], [], []]
expected: [null, null, null, null, 0, 0, null, 0]
- input:
operations: ["MinStack", "push", "getMin", "push", "getMin", "push", "getMin"]
args: [[], [5], [], [3], [], [7], []]
expected: [null, null, 5, null, 3, null, 3]
description: |
Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.