ByteDance Interview Question

Q: find the longest repeated substrings for example : abcabcabddd the you should return 4 (abc)