[LeetCode] 946. Validate Stack Sequences - 문제풀이
Description 주어진 배열의 순서대로 스택에 push, pop이 가능한지 여부를 반환하는 문제입니다. Given two integer arrays pushed and popped each with distinct values, return true if this could have been the result of a sequence of push and pop operations on an initially empty stack, or false otherwise. Example 1: Input: pushed = [1,2,3,4,5], popped = [4,5,3,2,1] Output: true Explanation: We might do the following sequence: push(1)..