HackerRank Day 2: Loops problem solution - TheCScience