Valid sudoku
Mediumhash setmatrix
board has 9 rows of 9 characters: a digit 1–9 or . for an empty cell. Return true if the filled digits never repeat within a row, a column or a 3×3 box. (You don't need to check that it's solvable.)
Example 1
Input: board = ["53..7....","6..195...",".98....6.","8...6...3","4..8.3..1","7...2...6",".6....28.","...419..5","....8..79"] Output: true
Example 2
Input: board = ["83..7....","6..195...",".98....6.","8...6...3","4..8.3..1","7...2...6",".6....28.","...419..5","....8..79"] Output: false
The first column has two 8s.
Constraints
- board.length == 9
- board[i].length == 9
- Digits 1–9 or '.'
Submit checks your solution against 9 tests, including hidden ones.
/**
* @param {string[]} board
* @return {bool}
*/
function isValidSudoku(board) {
}