Practice Find the Original Typed String II
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Problem Statement
Alice is attempting to type a specific string on her computer. However, she tends to be clumsy and may press a key for too long, resulting in a character being typed multiple times. You are given a string word, which represents the final output displayed on Alice's screen. You are also given a positive integer k. Return the total number of possible original strings that Alice might have intended to type, if she was trying to type a string of size at least k. Since the answer may be very large, return it modulo 10^9 + 7.
Source: Find the Original Typed String II on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
word = "aabbccdd", k = 7
5
# Example 2
word = "aabbccdd", k = 8
1
# Example 3
word = "aaabbb", k = 3
8
Constraints
Related LeetCode Problems
Practice more problems similar to Find the Original Typed String II.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.