HackerRank Java Map problem solution - TheCScience