created the solver class to hold logic for solving the puzzle