Problem
You get a string s of lowercase letters and stars *. Each star works like a backspace: it deletes the closest non-star character to its left, and the star itself disappears too. Apply every star and return the string that is left.
Example 1
- Input
- s = "leet**cod*e"
- Output
- "lecoe"
Example 2
- Input
- s = "erase*****"
- Output
- ""
In the first example the two stars remove t and e, and the third removes d.
Constraints
1 <= s.length <= 10^5s has only lowercase letters and *.Every star always has a character to delete.