Write a program to solve a Sudoku puzzle by filling the empty cells.
Empty cells are indicated by the character ‘.‘.
You may assume that there will be only one unique solution.

A sudoku puzzle...

...and its solution numbers marked in red.
class Solution:def validPos(self, board, row, col, c):x = 3 * int(row / 3) # 3*3 start x indexy = 3 * int(col / 3) # 3*3 start y indexfor i in range(9):if board[row][i] == c:return Falseif board[i][col] == c:return Falseif board[x + int(i / 3)][y + i % 3] == c:return Falsereturn Truedef solve(self, board, solved):while solved != 81 and board[int(solved / 9)][solved % 9] != ".":solved += 1if solved is 81:return Truei = int(solved / 9)j = solved % 9for c in "123456789":if self.validPos(board, i, j, c):board[i][j] = cif self.solve(board, solved):return Trueelse:board[i][j] = "."return False;def solveSudoku(self, board):""":type board: List[List[str]]:rtype: void Do not return anything, modify board in-place instead."""self.solve(board, 0)