Exercises/#93 Implement Queue Using Stacks
#93

Implement Queue Using Stacks

EasyπŸ“š Stack & Queue
50 XP

Problem

Implement a FIFO queue using only two stacks. Support push, pop, peek, and empty.

Examples

MyQueue β†’ push(1) β†’ push(2) β†’ peek()β†’1 β†’ pop()β†’1 β†’ empty()β†’false
stackqueuedesign
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

93 / 150

Your Solution

⚑ JavaScript

to save progress and use AI features