3686. Number of Stable Subsequences
You are given an integer array
nums.A subsequence is stable if it does not contain three consecutive elements with the same parity when the subsequence is read in order (i.e., consecutive inside the subsequence).
Return the number of stable subsequences.
Since the answer may be too large, return it modulo
109 + 7.
1 | class Solution { |