The Reconstruct Original Digits from English problem gives you a jumbled string containing letters from digit words (zero through nine). Reconstruct the digit counts and return them in sorted order as a string. This medium coding problem uses unique letter detection to identify digits in a specific order. The math, hash table, and string interview pattern is demonstrated.
Salesforce, Wix, and Google ask this because it tests systematic reasoning: some digits have unique letters that others don't. Once you extract those unique-letter digits, you can subtract their contributions and recover remaining digits. It rewards mathematical/linguistic pattern recognition.
Unique letter extraction in specific order. Identify digits by their unique letters:
s="owoztneoer". Count: {o:2,w:1,z:1,t:1,n:1,e:2,r:1}.
Reconstruct Original Digits From English demonstrates "unique identifier extraction" — a systematic elimination approach. Identify the most uniquely-identifiable items first, subtract their contribution, then continue. This pattern applies to similar "reconstruct from partial information" problems. Memorize the 5 unique letters: z,w,u,x,g → 0,2,4,6,8.
| Title | Difficulty | Topics | LeetCode |
|---|---|---|---|
| Integer to Roman | Medium | Solve | |
| Fraction to Recurring Decimal | Medium | Solve | |
| Roman to Integer | Easy | Solve | |
| Count Number of Texts | Medium | Solve | |
| Maximum Manhattan Distance After K Changes | Medium | Solve |