A regular stack gives you push, pop, and top. But getMin normally requires to scan the stack. The idea: at any point, the minimum is determined by the elements currently in the stack. When you push, you could track what the minimum is "at this stack height." One approach: use two stacks. One for values, one for minimums. Each position in the min stack stores the minimum of all elements below it.
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
$ curl repovive.com/roadmaps/maang-interview-prep/stacks/min-stack-hint
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░███████████████████████████████████████████████████████████████████████