Minimum Length Substrings Leetcode Solutions Java