DIY: Validate Stack Sequences

Solve the interview question "Validate Stack Sequences" in this lesson.

Problem statement

You are provided with two stack sequences, pushed and popped, with distinct values. Return true if and only if this could have been the result of a sequence of push and ...