#3. 字符串星号消除

    ID: 3 Type: Default 1000ms 256MiB Tried: 0 Accepted: 0 Difficulty: (None) Uploaded By: Tags>codingbatString-2gesp4字符串模拟

字符串星号消除

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.

ss

Output Format

Output the processed string.

result_sresult\_s

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 ss will not exceed 10510^5.