题目摘要
检查一个数独矩阵是否合法
解法
先检查行,再检查列,再检查每个三行三列的小矩阵
注意
检查三行三列小矩阵时,行标为i + k / 3,列标为j + k % 3
原题
Determine if a Sudoku is valid, according to: Sudoku Puzzles - The Rules.
The Sudoku board could be partially filled, where empty cells are filled with the character ‘.’.
A partially filled sudoku which is valid.
Note:
A valid Sudoku board (partially filled) is not necessarily solvable. Only the filled cells need to be validated.