I was asked this problem last week.
Given 2 strings S and T.
Task
Find the first occurrence of T in S and remove it
Repeat
Example:
S: aaabcbc
T: abc
Output: a (aaabcbc –> aabc –> a)
Can somebody suggest similar problem links and approach to sove this problem in a intuitive way as well as optimised way.
Thanks.
PS: Inbuilt function was not allowed.