<doocs>0036.Valid Sudoku_1.py
def isValidSudoku( board: List[List[str]]) -> bool:
    row = [[False] * 9 for _ in range(9)]
    col = [[False] * 9 for _ in range(9)]
    sub = [[False] * 9 for _ in range(9)]
    for i in range(9):
        for j in range(9):
            c = board[i][j]
            if c == '.':
                continue
            num = int(c) - 1
            k = i // 3 * 3 + j // 3
            if row[i][num] or col[j][num] or sub[k][num]:
                return False
            row[i][num] = True
            col[j][num] = True
            sub[k][num] = True
    return True
def sample_funcname ( var_0 : List [ List [ str ] ] ) -> bool :
    var_8 = [ [ False ] * 9 for var_6 in range ( 9 ) ]
    var_9 = [ [ False ] * 9 for var_6 in range ( 9 ) ]
    var_10 = [ [ False ] * 9 for var_6 in range ( 9 ) ]
    for var_11 in range ( 9 ) :
        for var_12 in range ( 9 ) :
            var_13 = var_0 [ var_11 ] [ var_12 ]
            if var_13 == '.' :
                continue
            var_17 = int ( var_13 ) - 1
            var_19 = var_11 // 3 * 3 + var_12 // 3
            if var_8 [ var_11 ] [ var_17 ] or var_9 [ var_12 ] [ var_17 ] or var_10 [ var_19 ] [ var_17 ] :
                return False
            var_8 [ var_11 ] [ var_17 ] = True
            var_9 [ var_12 ] [ var_17 ] = True
            var_10 [ var_19 ] [ var_17 ] = True
    return True
