What if we allow up to consecutive 1s, but not or more? Track the last digits, not just the last one. State: where is a bitmask of the last positions. Transition: shift the mask left, add new digit, check if all digits are 1 (invalid). For in base 10: track last 2 digits. State Time complexity: .
Space complexity: for the dp array.
space: . Gets expensive for large .