Run it
Both versions of the comparison, on the sequence that separates them.
The min stack grows only when the minimum changes, which is the honest answer to how much extra space it costs.
And the pair variant: easier to get right, at a fixed cost per element.
Why a scan is not allowed
The obvious min() walks the stack, which is O(n) and is exactly what the question forbids. Caching a single minimum in a variable is the next attempt and it fails on pop: when the minimum is removed, there is nothing to fall back to, and finding the new one is another scan.
So the structure has to remember the minimum at every level. A parallel stack does that: entry k is the minimum of the first k pushes, so popping a level restores the previous answer for free.
The <= that everybody gets wrong first
Push 2, then 1, then 1. With < the min stack is [2, 1]; with <= it is [2, 1, 1]. Now pop once. Both versions remove a 1 from the data, and the strictly-less version also removed its only 1 from the min stack — so it reports 2 while a 1 is still in the stack.
The editor below runs both and prints the two answers side by side. It is the single most common bug in this question, and an interviewer who asks for duplicates is asking about exactly this line.
The one-stack variants
Two alternatives come up as follow-ups, and both are worth knowing.
Store pairs. Push (value, min_so_far) and the minimum is stack[-1][1]. Simpler to get right, and it costs one extra number per element rather than one per new minimum — worse in the best case, identical in the worst.
Store deltas. Keep one stack and push the difference from the current minimum, tracking the minimum in a variable. It is O(1) extra space, it is genuinely clever, and it is fiddly enough that mentioning it as an option scores better than attempting it under time pressure.
What the question is testing
Whether you can turn "report an aggregate cheaply" into "keep the aggregate as part of the structure". That is the transferable idea: the same move gives a queue with O(1) minimum (two deques, the monotonic one), a sliding-window maximum, and a stack that reports its sum. The interviewer usually follows with one of those.
The second thing being tested is whether you volunteer the duplicate case yourself. Saying "I will use <= so equal minimums each get an entry" before being asked is the answer they are listening for.
Edge cases to raise
Volunteering these is most of what separates a correct answer from a good one.
min() on an empty stack. Decide whether it raises or returns a sentinel, and say which before writing it - an IndexError from self.mins[-1] is a reasonable answer if it is deliberate.
Space is proportional to how often the minimum changes, not to n. An ascending sequence leaves the min stack at length 1; a descending one makes it as long as the data. Worth stating, because it is the honest answer to "how much extra space?"
The two stacks must stay in step. Any method that touches data without considering mins - a clear(), a bulk load, a __setitem__ - is where this class breaks later.