You are given an integer array target and an integer n. You have an empty stack and a stream of the integers 1, 2, ..., n.
Two operations are allowed:
- "Push": read the next integer from the stream and push it onto the stack.
- "Pop": remove the integer on the top of the stack.
Build the stack so that, from bottom to top, it equals target. Stop reading the stream once it does. Return the operations used. The answer is unique.