AlgoMaster Logo

Implement Stack using Queues

operations=[push(1), push(2), push(3), pop(), top(), push(4), pop()]
0 / 25
push(1)push(2)push(3)pop()top()push(4)pop()012emptyqueue is empty
algomaster.io
Step:Start with an empty queue. The front of the queue will act as the stack top.