Problem
Write a function that solves a Sudoku puzzle by filling the board in place. The board is a 9 by 9 list of lists of single-character strings: digits "1" to "9", and "." for an empty cell. When you finish:
- each row, each column, and each of the nine 3 by 3 boxes contains the digits 1 to 9 exactly once, and - every digit that was given at the start is unchanged.
The function is solve_sudoku(board) (Python) / solveSudoku(board) (TypeScript). It returns nothing; the tests read the board after the call.
Example 1
before (row 0): ["5", "3", ".", ".", "7", ".", ".", ".", "."]
Example 2
after (row 0): ["5", "3", "4", "6", "7", "8", "9", "1", "2"]
Constraints
board.length == 9 and board[i].length == 9board[i][j] is a digit 1 to 9 or '.'.The puzzle has exactly one solution.