HackerRank Java End-of-file problem solution - TheCScience