Count the Hidden Sequences | Leetcode 2145