23 lines
675 B
Python
23 lines
675 B
Python
def isValidSudoku(board):
|
|
"""
|
|
:type board: List[List[str]]
|
|
:rtype: bool
|
|
"""
|
|
temp = []
|
|
for x in range(len(board)):
|
|
for y in range(len(board[x])):
|
|
if y not in temp:
|
|
temp.append(board[x])
|
|
else:
|
|
return False
|
|
|
|
|
|
print(isValidSudoku([["5","3",".",".","7",".",".",".","."]
|
|
,["6",".",".","1","9","5",".",".","."]
|
|
,[".","9","8",".",".",".",".","6","."]
|
|
,["8",".",".",".","6",".",".",".","3"]
|
|
,["4",".",".","8",".","3",".",".","1"]
|
|
,["7",".",".",".","2",".",".",".","6"]
|
|
,[".","6",".",".",".",".","2","8","."]
|
|
,[".",".",".","4","1","9",".",".","5"]
|
|
,[".",".",".",".","8",".",".","7","9"]])) |