Build the PrimitiveMedium
Min Stack
Implement a `MinStack` class with `push(x)`, `pop()`, `top()` and `get_min()`, all in O(1).
Scanning for the minimum on demand is O(n) and defeats the exercise. Keep a second stack of minima alongside the values. The follow-up is always duplicates: if you only push to the min-stack on a strict improvement, popping one copy of a repeated minimum discards it while an equal value is still in the stack.
What to expect: A timer starts when you begin. Edit the starter code, run it against the test suite as many times as you like, then finish when you're done. The reference solution and interviewer follow-up questions unlock only after you finish.