Problem
A partly filled 9 by 9 Sudoku board is given as a list of 9 strings, one per row. Each character is a digit 1 to 9 or . for an empty cell. Return true if the board breaks no rule so far:
- no digit repeats in any row, - no digit repeats in any column, - no digit repeats **in any of the nine 3 by 3 boxes**.
Only the filled cells need to be checked. You do not have to decide whether the puzzle can be solved.
Example 1
- Input
- row 0 = "1.......1"
- Output
- false
- Why
- two 1s in row 0
Example 2
row 0 = "1........", row 1 = ".1......."
Example 3
→ false (two 1s in the top-left box)
Example 4
- Input
- an empty board
- Output
- true
Constraints
board.length == 9board[i].length == 9board[i][j] is a digit 1-9 or '.'.