How to replace a substring of a string
Given three strings S, S1, and S2 consisting of N, M, and K characters respectively, the task is to modify the string S by replacing all the substrings S1 with the string S2 in the string S. Examples: Input: S = "abababa", S1 = "aba", S2 = "a"Output: abaExplanation:Change the substrings S[0, 2] and