Today's Question:  What does your personal desk look like?        GIVE A SHOUT

 ALL


  Overlap Detection

How does one detect when two strings overlap? In the case below, the four-letter suffix of string 1 matches the four-letter prefix of string 2.1: "Fire at Will"2: "William Riker is number one"Sometimes there are several matches; finding the longest is not always straight forward.1: "Have some CoCo and CoCo"2: "CoCo and CoCo is here."2: "CoCo and CoCo is here."2: "CoCo and CoCo is here."The naïve solution is to take ever smaller substrings of each string, compare them, then bail out when the first match is found. This is quick ...

7,026 0       PYTHON IMPLEMENTATION STRING OVERLAP DETECTION