Design a stack that supports finding maximum in O(1)
Filed under PayU
The question
Explain the time complexity of finding the maximum element in a standard stack and design a special stack data structure that retrieves the maximum in O(1) time.
No write-up yet. Related questions below have one.
Related PayU questions
Collected from public candidate posts and coding forums. Updated Nov 2026.