Will it be a little better memory-wise if we use an array for used1, and reset it every time we finish a row?
@jaqenhgar Thank you for this explanation as well !! Very useful!
a bit improvement based on your idea :D
Thanks for your sharing! It is easy to understand! But what is the running time for it? It seems to have 4 for loops in your function!
The best solution!
Thanks for sharing! Really amazing!
@StefanPochmann Interesting, would adding tuples like "seen += (c,j),(i,c),(i/3,j/3,c)" be equivalent to?:
I agree with the comment above. I solved this on my own and it took me some time to get the index right for the sub-grid case. In real interview case, I think simpler solution is easier to code and less prone to make mistakes.
No one has replied
this is nice !! Thanks for sharing
This is a way better answer in terms of readability
for i = 0..9, j = 0..9, the k box goes like this:
I implemented it the same way but removed the else statements and put all the "= true" statements at the end to make it a bit more readable
u are more ravishing then ever.XD
Is the space O(1) since it is constant? Just to confirm.
I like your code. Thanks
Nice solution! Though it seems too complicate for such a easy problem, it's good to represent the status of sudoku in soduku solover problem.
Disabled Categories are greyed out
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.