Longest Repeating Substring Leetcode Solution