I am not sure how to go about coding this. So, I have a string called S and a pattern string called M. I want to delete all occurrences of M in S. But, when I delete one occurrence of M in S, I could possibly create another. For example, given the word "aajjk" and the pattern "aj". After the first deletion, it would become "ajk". In this new string, another occurrence of "aj" has come after the first deletion. The final string after all deletions would then be "k". Could you give me some tips on how to approach this problem, some psuedocode would be helpful as I need practice in implementation.
Aucun commentaire:
Enregistrer un commentaire