Minimum Length Substrings Leetcode Problems Java