Leetcode 3330. Find the Original Typed String I
Given a final string produced when Alice may have long-pressed at most one key (extending a single run of identical characters), count how many original strings could yield it by grouping consecutive identical chars — each run of length k gives k-1 extra repeats, so the answer is 1 + sum(k-1) = 1 + n - number_of_runs.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
0
Hello Interview Premium
Your account is free and you can post anonymously if you choose.