This program implements a recursive algorithm to find a solution