#3. 字符串星号消除
字符串星号消除
Star Removal in String
Background
This problem involves string manipulation.
Problem Description
Return a version of the given string, where for every star () in the string the star and the characters immediately to its left and right are gone. So "ab*cd" yields "ad" and "ab**cd" also yields "ad".
Input Format
The input consists of a single line containing the string.
Output Format
Output the processed string.
Sample
ab*cd
"ad"
ab**cd
"ad"
sm*eilly
"silly"
Sample Explanation
For sample 1 "abcd": The star is between 'b' and 'c'. Removing 'b', '', and 'c' leaves 'a' and 'd', resulting in "ad". For sample 2 "ab**cd": The first star marks 'b', itself, and the star to its right for removal. The second star marks the star to its left, itself, and 'c' for removal. Overall, 'b', 'c', and both ''s are marked for removal, leaving 'a' and 'd', resulting in "ad". For sample 3 "smeilly": The star is between 'm' and 'e'. Removing 'm', '', and 'e' leaves 's', 'i', 'l', 'l', 'y', resulting in "silly".
Constraints
The length of the string will not exceed .