Determine if a 9x9 Sudoku board is valid. Only the filled cells need to be validated according to the following rules:
Note: A Sudoku board does not need to be solvable. Only the currently filled cells need to be validated.
[ ["5","3",".",".","7",".",".",".","."], ["6",".",".","1","9","5",".",".","."], [".","9","8",".",".",".",".","6","."], ["8",".",".",".","6",".",".",".","3"], ["4",".",".","8",".","3",".",".","1"], ["7",".",".",".","2",".",".",".","6"], [".","6",".",".",".",".","2","8","."], [".",".",".","4","1","9",".",".","5"], [".",".",".",".","8",".",".","7","9"] ]
Input: board = (9x9 grid above) Output: True Explanation: Each row, column, and 3x3 box contains distinct digits 1-9 (ignoring empty cells ".").
[ ["8","3",".",".","7",".",".",".","."], ["6",".",".","1","9","5",".",".","."], [".","9","8",".",".",".",".","6","."], ["8",".",".",".","6",".",".",".","3"], ["4",".",".","8",".","3",".",".","1"], ["7",".",".",".","2",".",".",".","6"], [".","6",".",".",".",".","2","8","."], [".",".",".","4","1","9",".",".","5"], [".",".",".",".","8",".",".","7","9"] ]
Input: board = (9x9 grid above, "8" appears twice in column 0) Output: False Explanation: The digit "8" appears twice in the first column (rows 0 and 3), violating the column rule.
board.length == 9board[i].length == 9board[i][j] is a digit 1-9 or ".".valid sudoku board