Implement Queue using Stacks

Medium

📝 Description

Implement a queue using two stacks with push, pop, peek, and empty operations

Input Format

Series of queue operations (push x, pop, peek, empty)

Output Format

Results of operations

Constraints

1 ≤ x ≤ 100 At most 100 operations

🔍 Sample Input

push(1), push(2), peek(), pop(), empty()
            

✅ Sample Output

1, 1, false
            

Code Editor

Please login to run and submit code.

Shortcuts: Ctrl+Enter to submit, Ctrl+Shift+R to run