Medium
078Min Stack
Simulate a min stack. Operations are push, pop, top, and getMin. Return outputs for top and getMin.
EXAMPLES
Example 1
Input
{
"operations": [
"push",
"push",
"push",
"getMin",
"pop",
"top",
"getMin"
],
"values": [
-2,
0,
-3,
0,
0,
0,
0
]
}
Output
[
-3,
0,
-2
]FUNCTION SHAPE
operations: stringArrayvalues: intArray→intArray