Sequence Pattern Matching Leetcode 75