Implement validatePuzzle.