1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| push 8, min: 8, stack[8], minStack: [8] push 4, min: 4, stack[8, 4], minStack: [8, 4] push 2, min: 2, stack[8, 4, 2], minStack: [8, 4, 2] push 6, min: 2, stack[8, 4, 2, 6], minStack: [8, 4, 2] push 1, min: 1, stack[8, 4, 2, 6, 1], minStack: [8, 4, 2, 1] push 9, min: 1, stack[8, 4, 2, 6, 1, 9], minStack: [8, 4, 2, 1] push -1, min: -1, stack[8, 4, 2, 6, 1, 9, -1], minStack: [8, 4, 2, 1, -1] push 3, min: -1, stack[8, 4, 2, 6, 1, 9, -1, 3], minStack: [8, 4, 2, 1, -1] pop 3, min: -1, stack[8, 4, 2, 6, 1, 9, -1], minStack: [8, 4, 2, 1, -1] pop -1, min: 1, stack[8, 4, 2, 6, 1, 9], minStack: [8, 4, 2, 1] pop 9, min: 1, stack[8, 4, 2, 6, 1], minStack: [8, 4, 2, 1] pop 1, min: 2, stack[8, 4, 2, 6], minStack: [8, 4, 2] pop 6, min: 2, stack[8, 4, 2], minStack: [8, 4, 2] pop 2, min: 4, stack[8, 4], minStack: [8, 4] pop 4, min: 8, stack[8], minStack: [8] pop 8, stack is empty
|