Replace By X

easy
1. Given a string and a pattern. 
 2. Replace all the continuous occurrence of pattern with a single X in the string.

Input Format

abababcdefababcdab ab

Output Format

XcdefXcdX

Constraints

1 <= size of str,s <= 1000

Notice

Try First, Check Solution later

1. You should first read the question and watch the question video.
2. Think of a solution approach, then try and submit the question on editor tab.
3. We strongly advise you to watch the solution video for prescribed approach.

Example

Input
abababcdefababcdab
ab
Output
XcdefXcdX
Previous
Check If Array Is Sorted
Next
Factor Combinations

Related Questions