Valid Sudoku
https://leetcode.com/problems/valid-sudoku/description/
Determine if a Sudoku is valid, according to:Sudoku Puzzles - The Rules.
The Sudoku board could be partially filled, where empty cells are filled with the character
'.'
.
Thoughts
根据sudoku的定义建立三个map, 判断是否在同一行,列还是块。
Code
Analysis
Errors:
(i / 3) * 3 和 i并不相等
时空复杂度都是O(n^2).
PreviousImplement Magic DictionaryNext1452. People Whose List of Favorite Companies Is Not a Subset of Another List
Last updated
Was this helpful?