Available question text
Count how many original strings (of length at least k) could have produced the given final word if each intended character may have been long-pressed into one or more copies — equivalently, for each run of identical letters of length L choose how many original occurrences (1..L) it came from, with weight C(L-1, m-1). The core challenge is combinatorics + knapsack-style DP (k ≤ 2000, word length up to 5e5) to aggregate these per-run choices modulo 1e9+7.
Related questions
Continue with questions that share topics or the same question type.
- Find the Original Typed String I
Coding
- Check if an Original String Exists Given Two Encoded Strings
Coding
- Find All Anagrams in a String
Coding · Hash Table · Sliding Window · String
- Find And Replace in String
Coding
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 3333. Find the Original Typed String II
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source