This question evaluates the ability to perform constraint validation on a fixed-size 9×9 grid, testing skills in matrix/array handling, duplicate detection and use of simple data structures for correctness checking.
You are given a 9×9 grid representing a partially filled puzzle. Each cell contains either:
'1'
–
'9'
, or
'.'
meaning empty.
Determine whether the current filled cells are valid under these rules:
'1'
–
'9'
repeats within any row.
Return true if the filled cells satisfy all rules; otherwise return false.
board
— a 9×9 array of characters
If a row contains two '5' values (ignoring '.'), the board is invalid and you should return false.