Leetcode Find The Longest Substring In Java