36. Valid Sudoku

    xiaoxiao2021-12-14  19

    题目摘要 检查一个数独矩阵是否合法

    解法 先检查行,再检查列,再检查每个三行三列的小矩阵

    注意 检查三行三列小矩阵时,行标为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.

    转载请注明原文地址: https://ju.6miu.com/read-964830.html

    最新回复(0)