Given three strings: `source`, `target`, and `replacement`, replace all occurrences of `source` in `target` with `replacement`. If `source` is not found in `target`, return the original `target` string.
Explanation: Replacing 'abc' in 'abcdabc' with 'xyz' results in 'xyzdxyz'
Explanation: Replacing 'def' in 'abcdefgh' with 'ghi' results in 'abghi'
Analyze constraints and compute optimal solutions step-by-step.
No dry run loaded.
🚀 Practice this problem
Run code, get AI hints & track streak