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