Started writing the function validatePuzzle.