← Nvidia questions

Stack supporting getMin in O(1) time and extra space

Filed under Nvidia

Design a stack that supports push, pop, top and getMin, where all operations run in O(1) time and the minimum is tracked using only O(1) extra space beyond the stack itself (no second stack).

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Nvidia questions

Collected from public candidate posts and coding forums. Updated Nov 2026.