Merge Two Strings by Maximum Edge Overlap

Given two ASCII strings str1 and str2, merge them into one string.

For an ordering A + B:

  • Find the longest suffix of A that is equal to a prefix of B.
  • Keep that overlapping par...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: