Partially solve the longest repeating substring using kmp, but the solution is still defective.