Check if an array is stack-sortable

后端 未结 0 1204
小鲜肉
小鲜肉 2021-01-25 12:53

Here is the question:

We want to rearrange a sorted array [1, ..., N] using a stack.

Ex:

  • push 1 then pop 1.
  • push 2 then push 3 then pop twice
相关标签:
回答
  • 消灭零回复
提交回复
热议问题