Google / Microsoft Interview Question — LeetCode 833
In this post, we are going to discuss leetcode 833 — Find And Replace in String, which is recently asked in Google, and Microsoft interviews.
Problem Analysis
You are given a 0-indexed string
s
that you must performk
replacement operations on. The replacement operations are given as three 0-indexed parallel arrays,indices
,sources
, andtargets
, all of lengthk
.To complete the replacement operation:
1. Check if the substring
sources[i]
occurs at index…