HackerRank Java String Reverse problem solution - TheCScience