Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 2466. Count Ways To Build Good Strings
You can repeatedly append either a block of '0' characters of length zero or a block of '1' characters of length one; count how many distinct binary strings have total length in [low, high]. This is a counting/Dynamic Programming problem (like coin-change/compositions) where dp[len] = dp[len-zero] + dp[len-one], and you sum dp[low..high] modulo 1e9+7.
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.