Recursive way of doing these sum of paths question