updated to matrix method to check validity
This commit is contained in:
parent
790be3a565
commit
a8cf9a4807
@ -3,10 +3,14 @@ def isValidSudoku(board):
|
||||
:type board: List[List[str]]
|
||||
:rtype: bool
|
||||
"""
|
||||
x = []
|
||||
y = []
|
||||
for x in board:
|
||||
|
||||
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",".",".","."]
|
||||
|
||||
Loading…
Reference in New Issue
Block a user