puzzle project provides puzzle.py module containing function validate_board(board). To check whether the puzzle is ready for the game, import and invoke validate_board function with the argument (list of strings) representing the board.
The board is considered valid iff all of the following conditions are satisfied:
- Each group of cells of the same color on the board has unique numbers (digits between 1 and 9)
- Each row of the board has unique numbers (digits between 1 and 9)
- Each column of the board has unique numbers (digits between 1 and 9)