Back to problems

Merge Two Strings by Maximum Edge Overlap

Algorithm · Apple · Easy

Merge Two Strings Easy · Topics · Company Tags · Hints You are given two ASCII strings str1 and str2. Combine them into one final string by overlapping the end of the first selected string with the beginning of the second selected string. For an ordering A + B, let k be the largest value such that the last k characters of A are exactly the first k characters of B. The merged result is A joined with B after removing those first k characters from B. If no non-empty match…

Checking your access…