Design a stack that supports standard operations (push, pop, top) and a getMin() operation that retrieves the minimum element in the stack in O(1) time. Optimize the implementation to use as little…
You've read your 3 free write-ups
Sign up free to keep reading. Your account opens the first 10 questions of every company.