code: def _parse_grid(self, grid):
          
          chars = [c for c in grid if c in DIGITS or c in "0."]
          if len(chars) != 9**2:
              raise ValueError("expected 9x9 grid")
          return [self.litmap[self.X[i // 9 + 1, i % 9 + 1, int(c)]]
                  for i, c in enumerate(chars) if c in DIGITS]
docs: Return the input constraints for a Sudoku grid.