Minimum Length Substrings Leetcode Contest Solution