Exercises/#92 Min Stack
#92

Min Stack

MediumπŸ“š Stack & Queue
70 XP

Problem

Design a stack that supports push, pop, top, and getMin in O(1) time.

Examples

MinStack β†’ push(-2) β†’ push(0) β†’ push(-3) β†’ getMin()β†’-3 β†’ pop() β†’ top()β†’0 β†’ getMin()β†’-2
stackdesign
AI Assistantβ€” powered by AI

Unlock hints progressively β€” start gentle, go deeper only if needed.

πŸ’‘

Level 1: Gentle Nudge

A subtle direction

πŸ—ΊοΈ

Level 2: Approach

The algorithm to use

πŸ”

Level 3: Detailed

Step-by-step guidance

92 / 150

Your Solution

⚑ JavaScript

to save progress and use AI features