Quantcast
Channel: coder i|o: #strings
Viewing all articles
Browse latest Browse all 138

Overlap Detection in strings, with code

$
0
0

From neil.fraser.name:

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 Sometimes there are several matches; finding the longest is not always straight forward. The naïve solution is to take ever smaller substrings of each string, compare them, then bail out when the first match is found.

Click here to read more

Tagged: #algorithms #strings


Viewing all articles
Browse latest Browse all 138

Trending Articles