Maximum Repeating Substring Leetcode Javascript 30