Who can finger out this Sudoku is valid or not ?
Don't have to calculate row and column 9 times in each loop.
@lencha said in Short+Simple Java using Strings:
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.
This is a way better answer in terms of readability
No one has replied
this is nice !! Thanks for sharing
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.