added is_valid_sudoku

This commit is contained in:
ayxan 2022-09-18 00:48:36 +04:00
parent 05b677c7f5
commit 30ce7fdc37

View File

@ -81,6 +81,10 @@ class AcceptedMedium:
def is_valid_sudoku(self, board: List[List[str]]) -> bool:
# sourcery skip: list-comprehension, use-itertools-product
"""
Link: https://leetcode.com/problems/valid-sudoku/
Runtime: 105 ms
"""
for i in board:
r = [j for j in i if j != '.' ]
if len(set(r)) < len(r): return False