Problem 1441 · Medium

Build an Array With Stack Operations

Produce the push and pop operations that build a target sequence from the stream 1 through n. The visual steps through the stream and shows the stack contents after each operation.

Open the interactive visualisation