A recursive solution -- interesting!