[clug] Substring repetition detection

Martin Pool mbp at samba.org
Wed Jun 25 17:08:19 EST 2003

On 25 Jun 2003, Michael Still <mikal at stillhq.com> wrote:

> Anyways, I can't think of a good answer. Any hints?

Brute force and ignorance. :-)

Consider all n-character substrings (n>=2) starting at position m
(m>=0).  Is that equal to the substring starting at m+n?  If so, what
about m+2n, etc.  Then recursively check for more repeated strings
later on.

Repeat for all n, m, and keep the best solution.  


More information about the linux mailing list