30:00
Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.
−231≤val≤231−1-2^{31} \leq \text{val} \leq 2^{31} - 1−231≤val≤231−1
Operations pop, top, and getMin are always called on non-empty stacks.
pop
top
getMin
At most 3×1043 \times 10^43×104 calls in total to push, pop, top, and getMin.
push
Init stacks
Op: