Maximum Repeating Substring Leetcode Python