verify the legality of the user-inputted puzzle before solving