Problem Description
Loading...
Problem Analysis
This tests your understanding of stacks and queues
But you don’t need to use them directly
You only need to make a judgment
Because the problem says it’s either a queue or a stack
Because if it’s a queue, the elements must correspond one-to-one
So you can check whether they are equal one by one
Otherwise it’s a stack
cpp
| |
Problem link: 【DidaOJ】[283]Stack ? Queue ?