Given a text and a pattern. Replace all the occurrences of the pattern in the text by another given string. For Example: If text = “aabaabab” and pattern = “ab”. Then after replacing pattern in the text by “abc” the output should be “aabcaabcabc”. The trivial solution would be to do a brute-force search of […]