HackerRank Java Substring Comparisons problem solution - TheCScience