typed, everything they entered: lowercase letters mixed with digits.
Each digit erases the nearest not-yet-erased letter to its left and does not itself appear in the text. Digits are processed from left to right. Return the resulting text.
It is guaranteed that every digit has a letter to erase.typed="cat7s" → 'cas'
The 7 erases the t, leaving "cas".
typed="ab12cd" → 'cd'
1 erases b, then 2 erases a; "cd" remains.
typed="note" → 'note'
No digits, so the string stays as it is.
typed consists of lowercase Latin letters and digitstyped="cat7s"
'cas'
Run checks the first 3 tests in your browser. Submit checks all 75 tests on the server, hidden ones included.