Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 3686. Number of Stable Subsequences
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.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.