This is merely my personal review of all the typical problems that constitute the mindset for Data Structures and Algorithms (DSA). python solution provided
For the remaining types of problems, please refer to my channel.
everecursion-优快云博客everecursion关注python,github,chatgpt领域.https://blog.youkuaiyun.com/gcsyymm
Valid Sudoku
Valid Sudokuhttps://leetcode.cn/problems/valid-sudoku/
Difficulty:MED
class Solution:
def isValidSudoku(self, board: List[List[str]]) -> bool:
# check each row is valid
for row in board:
row_set = set()
for num in row:
if num != ".":
if num in row_set:
return False
row_set.a