#258. 字符串模式移除
字符串模式移除
Remove Unlucky Patterns
Background
Congcong has recently been studying strings. He discovered that certain string patterns bring bad luck.
Problem Description
Suppose a string pattern of the form "yXk" is considered unlucky, where 'X' can be any character. Given a string, return a new version where all unlucky "yXk" patterns have been removed. It is guaranteed that these unlucky patterns will not overlap in the original string.
Input Format
Input is given from Standard Input in the following format.
A string .
Output Format
Output is printed to Standard Output in the following format.
The string after removing all unlucky patterns.
Sample
yakpak
"pak"
pakyak
"pak"
yak123ya
"123ya"
Sample Explanation
For the first sample, the string "yakpak" contains "yak\