The Find the Original Typed String I interview question is a string simulation and counting problem. You are given a string typed that was supposedly typed by a user. However, some keys might have been pressed for too long, causing characters to be repeated. Your goal is to find the total number of distinct "original" strings that could have resulted in the typed string, assuming the only error was character repetition.
Companies like Microsoft and Amazon ask the Find the Original Typed String I coding problem to assess a candidate's basic string manipulation and counting logic. It tests your ability to identify "clusters" of identical characters and understand how variations in those clusters affect the total number of possible original strings. It evaluations your grasp of linear scanning and basic combinatorics within a String interview pattern.
This problem follows the Linear Scan and Counting pattern.
Suppose typed = "aabb".
Whenever a string problem involves "repeating characters," your first thought should be a Linear Scan to identify character clusters. This is a recurring theme in compression and data cleaning problems.
| Title | Difficulty | Topics | LeetCode |
|---|---|---|---|
| Detect Capital | Easy | Solve | |
| Score of a String | Easy | Solve | |
| Valid Word | Easy | Solve | |
| Delete Characters to Make Fancy String | Easy | Solve | |
| Length of Last Word | Easy | Solve |