HackerRank Java Strings Introduction problem solution - TheCScience