Search
⌘K

Leetcode 1441. Build an Array With Stack Operations

Given a strictly increasing target array drawn from 1..n, simulate reading the stream 1..n and output "Push" for each number you read, followed by "Pop" whenever that number is not in target, stopping once the stack (bottom-to-top) equals target.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.