Design a stack that supports push(x), pop(), top() and get_min() (retrieve the minimum element currently in the stack), all in constant time. Pay attention to a clean API: define behaviour for an…
You've read your 3 free write-ups
Sign up free to keep reading. Your account opens the first 10 questions of every company.