Queue Using Two Stacks
Implement a queue using two stacks. Process commands push x, pop, peek, empty and print the result of every pop, peek and empty (true/false).
Constraints
1 <= q <= 10^5
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.