algorythms
Arrays & Hashing
LC #36Medium

Valid Sudoku

Arrays & Hashing

Problem

Determine if a 9 x 9 Sudoku board is valid. Only the filled cells need to be validated according to the rules.

arrayhash-setmatrix

Constraints

  • board.length == 9, board[i].length == 9
  • board[i][j] is a digit 1-9 or '.'

Example

Inputboard = [["5","3",".",".","7",".",".",".","."],...]
Outputtrue
Why

Check if each row, column, and 3x3 box contains digits 1-9 without repetition.

Hints — reveal one at a time