Free written solutionCount Ways To Build Good Strings (LeetCode 2466): Solution and Explanation
Count the strings you can build by repeatedly appending a block of zeros or a block of ones, keeping only those whose length lands between low and high.
Read the intuition, approach, code and complexity →