解題說明
C++ 解法
複雜度分析
虛擬碼
1. Initialize an empty stack and pointer j = 0 for popped array.
2. For each value in pushed:
a. Push value onto stack.
b. While stack is not empty AND top == popped[j]:
Pop from stack, increment j.
3. Return true if stack is empty, false otherwise.