Longest Repeating Substring Leetcode Solution 1984