HackerRank Day 5: Loops problem solution - TheCScience