Sudoku Solver

Complete a 9 by 9 Sudoku board in place. Every row, column and 3 by 3 box must contain the digits 1 through 9 exactly once. A dot is a blank; all other cells…

Complete a 9 by 9 Sudoku board in place. Every row, column and 3 by 3 box must contain the digits 1 through 9 exactly once. A dot is a blank; all other cells are one-character digit strings. The given board has exactly one solution. Preserve every given digit and mutate the original board. Implement solve_sudoku(board) in Python or solveSudoku(board) in the other languages; return no replacement board.

- The board has exactly 9 rows and 9 cells per row. - Cells are literal strings "." or "1" through "9" (char in Java/C++). - Givens have no row, column or box conflicts, and exactly one completion exists. - Unsolvable and multiply solvable boards are outside this problem contract. - Return None in Python, undefined in JavaScript, and void in Java/C++. - Coding supports every source-valid 9 by 9 board, including hard unique boards. - Complete teaching timelines use only the registered curated presets; they do not define the coding domain.

Example 1: input board = [[".","6","2","8","5","7","4","9","3"],["5","3","4","1","2","9","6","7","8"],["7","8","9","6","4","3","5","2","1"],["4","7","5","3","1","2","9","8","6"],["9","1","3","5","8","6","7","4","2"],["6","2","8","7","9","4","1","3","5"],["3","5","6","4","7","8","2","1","9"],["2","4","1","9","3","5","8","6","7"],["8","9","7","2","6","1","3","5","4"]]; output [["1","6","2","8","5","7","4","9","3"],["5","3","4","1","2","9","6","7","8"],["7","8","9","6","4","3","5","2","1"],["4","7","5","3","1","2","9","8","6"],["9","1","3","5","8","6","7","4","2"],["6","2","8","7","9","4","1","3","5"],["3","5","6","4","7","8","2","1","9"],["2","4","1","9","3","5","8","6","7"],["8","9","7","2","6","1","3","5","4"]]. The missing top-left digit is 1. All given characters remain unchanged.

Example 2: input board = [["1","6","2","8","5","7","4","9","3"],["5","3","4","1","2","9","6","7","8"],["7","8","9","6","4","3","5","2","1"],["4","7","5","3","1","2","9","8","6"],["9","1","3","5","8","6","7","4","2"],["6","2","8","7","9","4","1","3","5"],["3","5","6","4","7","8","2","1","9"],["2","4","1","9","3","5","8","6","7"],["8","9","7","2","6","1","3","5","4"]]; output [["1","6","2","8","5","7","4","9","3"],["5","3","4","1","2","9","6","7","8"],["7","8","9","6","4","3","5","2","1"],["4","7","5","3","1","2","9","8","6"],["9","1","3","5","8","6","7","4","2"],["6","2","8","7","9","4","1","3","5"],["3","5","6","4","7","8","2","1","9"],["2","4","1","9","3","5","8","6","7"],["8","9","7","2","6","1","3","5","4"]]. An already complete valid board needs no placement.

Category: Recursion. Topic: recursion. Difficulty: Hard. Patterns: backtracking.