HackerRank Day 9: Recursion 3 problem solution - TheCScience