updated to matrix method to check validity

This commit is contained in:
Jacob Delgado 2023-08-22 23:30:34 -07:00
parent 790be3a565
commit a8cf9a4807

View File

@ -3,10 +3,14 @@ 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",".",".",".","."]
,["6",".",".","1","9","5",".",".","."] ,["6",".",".","1","9","5",".",".","."]