Available question text
Count the number of subsequences of nums that do not contain three consecutive elements of the same parity, returning the result modulo 1e9+7. With n up to 1e5, this is typically solved by dynamic programming/state-tracking that remembers the last one or two parities to avoid forming parity triples.
Related questions
Continue with questions that share topics or the same question type.
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
Meta
Leetcode 3686. Number of Stable Subsequences
Interview reported: Feb 18, 2026 · 1 source report
MID_LEVEL
Source snapshot: Nov 12, 2026
View source