Leetcode 2145 Count the hidden sequences

The problem asks us to find the number of possible hidden sequences of length n+1 where all the values are in the range [lower, upper]…