screen. We know the person meant to type a word of length at least min_len. How many different words could they have meant?
The answer can be huge, so return it modulo 10⁹ + 7.screen="aabbb", min_len=3 → 5
The run "aa" could have been 1 or 2 letters and "bbb" 1 to 3: 2 · 3 = 6 options. Only "ab" is shorter than 3, so the answer is 5.
screen="xyz", min_len=2 → 1
There are no repeats, so the intended word can only be "xyz".
screen="ooo", min_len=4 → 0
The intended word is never longer than what is on screen, and that is only 3 letters.
screen consists of lowercase English lettersscreen="aabbb", min_len=3
5
Run checks the first 3 tests in your browser. Submit checks all 106 tests on the server, hidden ones included.