Hope I am not too late to ask questions. How is it that the double for loop you wrote in the answer actual iterates through the board? For ( int i = 0; i < board.length; i ++) For (int j = 0; j < board[i].length; j ++) Isn't this how to traverse through a 2-D matrix/ array ?
You are exactly right. The double for loop is used to traverse over a 2-D matrix. But what is that? It is a grid composed of rows and columns. The sudoku board is a grid composed or rows and columns. So it is indeed a 2-D array/matrix. Now, board.length is finding the number of rows And board[i].length is finding the number of columns. In this case we know the board has 9 rows and 9 columns. I hope this helps. If not, please let me know exactly where you are confused and I will explain further.
In this Question since we know the grid is 9*9 then the time is not depended on the input. We will always go over all 81 fields in the board. So the time is O(81) = O(1) aka constant time. Now, if they said that the grid is N * N then the time is O(n^2)
Very simple and intuitive explanation. Really appreciate it
Thank you!
thank you i was lost until i watched you video on this
Thank you, I am so glad I helped you out!
Very simple and easy to understand approach. Really appreciate this effort from your side
Thank you. I am glad you found it helpful!
A great explanation on the individual boxes! None else explains this in their code. They just copy and memorize. A terrible way to teach. Thanks!!
Thank you, I am really glad you found the video helpful!
WOW, I never thought about using a single HashSet. That is so smart, thank you for sharing and for great explanation!
Thank you so much!
Short and crisp 👏
Thank you!
I went over multiple videos, this was by far the best explanation
Thank you! Glad it was helpful!
Thanks for this explanation, wish I could give this more than one thumbs up😊
You are so kind. Thank you and glad it was helpful!!
This is so good approach, thanks a lot.
Glad it was helpful!
You should make more videos, love your explanation would watch a whole DS&A playlist by you :)
Thank you so much!
this was great. I have immediately subscribed
Thank you so much!!
Thanks. Only explanation I understood.
I am glad I was able to help!
Very smart technique! Thank you for great explanation.
Thank you!
Could you please post more, your videos are the best on youtube!
Thank you 🙏 I am having a really hard time to find the time to shoot the videos. I will try though
Thank You , very well explained !
Thank you so much!
Very very good explanation! Ty
Thank you!
Hope I am not too late to ask questions. How is it that the double for loop you wrote in the answer actual iterates through the board?
For ( int i = 0; i < board.length; i ++)
For (int j = 0; j < board[i].length; j ++)
Isn't this how to traverse through a 2-D matrix/ array ?
You are exactly right. The double for loop is used to traverse over a 2-D matrix. But what is that? It is a grid composed of rows and columns. The sudoku board is a grid composed or rows and columns. So it is indeed a 2-D array/matrix. Now, board.length is finding the number of rows And board[i].length is finding the number of columns. In this case we know the board has 9 rows and 9 columns.
I hope this helps. If not, please let me know exactly where you are confused and I will explain further.
Please continue your content, much appreciated! Liked and subscribed.
I really appreciate you!
Great explanation as always.
Thank you so much!
wow, awesome !
Time complexity will be O(n^2) ?
In this Question since we know the grid is 9*9 then the time is not depended on the input. We will always go over all 81 fields in the board. So the time is O(81) = O(1) aka constant time. Now, if they said that the grid is N * N then the time is O(n^2)
Why you have used strings in hash set
That was great
Thank you!