Add recursion solution from mahimahi42