#Q50. 「一本通 2.2 练习 4」Censoring
「一本通 2.2 练习 4」Censoring
Description
Original source: USACO 2015 Feb. Silver
Given two strings and , repeatedly find a substring in from front to back, delete it, and fill the gap by shifting the remaining characters forward. Repeat this process until no longer contains as a substring. Output the final string .
Input Format
The first line contains a string , and the second line contains a string .
Output Format
Output the processed string .
Sample 1
whatthemomooofun
moo
whatthefun
Constraints & Hints
For all test cases, , and it is guaranteed that the strings consist only of lowercase letters.
Related
In following homework: