title: Longest Non-Overlapping Substring
body: <p>I wonder if anyone knows the (optimal?) algorithm for longest recurring non-overlapping sub string.</p>
  
  <p>For example, in the string</p>
  
  <p>ABADZEDGBADEZ</p>
  
  <p>the longest recurring would be "BAD". Incidentally if there is no such result, the algorithm should alert that such a thing has occurred. My guess is that this involves suffix trees.</p>
  
  <p>I'm sure this must exist somewhere already. Thanks for the help!</p>