# Number of Good Binary Strings
[Link to Leetcode problem](https://leetcode.com/problems/number-of-good-binary-strings/description/)
## Problem Statement
A binary string is a sequence of characters consisting only of '0's and '1's. In a binary string, consecutive identical digits form "blocks". For example, in the string `0011101111100`, the blocks of '0's have lengths $2, 1, 2$ and the blocks of '1's have lengths $3, 5$.
A binary string is considered **good** if it satisfies three conditions:
1. **Length Constraint**: The length of the string, say $L$, must be within a specified range: $minLength \le L \le maxLength$.
2. **Ones Constraint**: Every block of consecutive '1's in the string must have a size (length) that is a multiple of $oneGroup$. For example, if $oneGroup = 3$, then blocks of '1's can only be of size $3, 6, 9, \ldots$. If the string contains no '1's, this constraint is considered satisfied.
3. **Zeros Constraint**: Every block of consecutive '0's in the string must have a size (length) that is a multiple of $zeroGroup$. For example, if $zeroGroup = 2$, then blocks of '0's can only be of size $2, 4, 6, \ldots$. If the string contains no '0's, this constraint is considered satisfied.
Your task is to find the total number of good binary strings. Since this number can be very large, return the result modulo $10^9 + 7$.
## Input Format
The input consists of a single line containing four integers: $minLength, maxLength, zeroGroup, oneGroup$.
- $minLength$: The minimum allowed length for a good binary string.
- $maxLength$: The maximum allowed length for a good binary string.
- $zeroGroup$: The required multiple for lengths of '0' blocks.
- $oneGroup$: The required multiple for lengths of '1' blocks.
## Output Format
Output a single integer, the total count of good binary strings modulo $10^9 + 7$.
## Sample Test Cases
### Sample Input 1
```
2 3 2 1
```
### Sample Output 1
```
5
```
### Sample Input 2
```
2 2 1 1
```
### Sample Output 2
```
4
```
## Constraints
- $1 \le minLength \le maxLength \le 10^5$
- $1 \le zeroGroup \le maxLength$
- $1 \le oneGroup \le maxLength$
- Time limit: 1 second
- Memory limit: 256 MB
## Explanation
### Sample 1
For $minLength = 2, maxLength = 3, zeroGroup = 2, oneGroup = 1$:
Strings of length 2:
- `00`: Block of '0's has length $2$. $2 \pmod {zeroGroup=2} = 0$. Good.
- `11`: Block of '1's has length $2$. $2 \pmod {oneGroup=1} = 0$. Good.
- `01`: Block of '0's has length $1$. $1 \pmod {zeroGroup=2} \ne 0$. Not good.
- `10`: Block of '0's has length $1$. $1 \pmod {zeroGroup=2} \ne 0$. Not good.
Strings of length 3:
- `000`: Block of '0's has length $3$. $3 \pmod {zeroGroup=2} \ne 0$. Not good.
- `111`: Block of '1's has length $3$. $3 \pmod {oneGroup=1} = 0$. Good.
- `001`: Block of '0's has length $2$. $2 \pmod {zeroGroup=2} = 0$. Block of '1's has length $1$. $1 \pmod {oneGroup=1} = 0$. Good.
- `011`: Block of '0's has length $1$. $1 \pmod {zeroGroup=2} \ne 0$. Not good.
- `100`: Block of '1's has length $1$. $1 \pmod {oneGroup=1} = 0$. Block of '0's has length $2$. $2 \pmod {zeroGroup=2} = 0$. Good.
- `110`: Block of '0's has length $1$. $1 \pmod {zeroGroup=2} \ne 0$. Not good.
- `010`: Block of '0's has length $1$. $1 \pmod {zeroGroup=2} \ne 0$. Not good.
- `101`: Block of '0's has length $1$. $1 \pmod {zeroGroup=2} \ne 0$. Not good.
The good strings are `00`, `11`, `111`, `001`, `100`. Total count is $5$.
### Sample 2
For $minLength = 2, maxLength = 2, zeroGroup = 1, oneGroup = 1$:
Strings of length 2:
- `00`: Block of '0's has length $2$. $2 \pmod {zeroGroup=1} = 0$. Good.
- `11`: Block of '1's has length $2$. $2 \pmod {oneGroup=1} = 0$. Good.
- `01`: Block of '0's has length $1$. $1 \pmod {zeroGroup=1} = 0$. Block of '1's has length $1$. $1 \pmod {oneGroup=1} = 0$. Good.
- `10`: Block of '1's has length $1$. $1 \pmod {oneGroup=1} = 0$. Block of '0's has length $1$. $1 \pmod {zeroGroup=1} = 0$. Good.
The good strings are `00`, `11`, `01`, `10`. Total count is $4$.
Loading problem statement...