Valid Stack Sequence Leetcode Contest Predictor Definition