First Repeating Substring Leetcode