Do you expect us to write the algorithm in part 3, or use an already-designed one?
You should be able to write it.
It's okay if it's k*n, where n is the length of the "master string" (the one which is being mutated) and k is the length of the "pattern string"
You can't just shove stuff down each time, because that will be an O(n^2) algorithm.
Use good program design. Separate responsibilities. For example, you might want to separate the task of finding the pattern from the task of replacing at a particular position.
Use C knowledge and think about efficiency.
Why do you have so many other methods in the class?
Good answer: The other methods are there to help you think about the data structure.
Bad answer: The first time I gave this problem, I asked students to implement not just
replace, but also
remove, and .... That was too much work.