Substring In Java Leetcode Solutions