The longest repeated substring

Is there a solution in Mathematica to the problem of finding the longest substring in a sequence that appears at least twice? For example, {1,2,3, 4, 5, 2, 3} has the solution {2,3} or "ABCDEDEFDEFA" to the solution "DEF".