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