Problem 946 · Medium

Validate Stack Sequences

Check whether a given pop order could arise from pushing the values in a given sequence onto a stack. The visual shows the stack with pushes and pops moving through the two sequences.

Open the interactive visualisation