Min stack
Your task
Implement a stack supporting push, pop, top, and getMin (the minimum element currently in the stack) all in O(1). Process ops: ['push', x], ['pop'], ['top'], ['getMin']. pop returns nothing. Return the list of values produced by 'top' and 'getMin' ops, in order. Assume top/getMin/pop are never called on an empty stack.
Examples
min_stack_ops(ops: list[list]) -> list[int]Example 1
Input
min_stack_ops([["push", -2], ["push", 0], ["push", -3], ["getMin"], ["pop"], ["top"], ["getMin"]])Output
[-3, 0, -2]