Valid Sudoku - Amazon Interview Question - Leetcode 36 - Python

preview_player
Показать описание


0:00 - Read the problem
4:49 - Drawing Explanation
8:50 - Coding Explanation

leetcode 36

#valid #sudoku #python
Disclosure: Some of the links above may be affiliate links, from which I may earn a small commission.
Рекомендации по теме
Комментарии
Автор

Bro I'm literally in awe when you used simple division of indices with 3 to point to a particular square. Amazing as always.

ashtag
Автор

this is the first medium problem that ive done myself which aligns exactly with the optimal solution, i feel accomplished 😅

Hys-
Автор

the row/3 and colum/3 idea is sooo neat i love it. I was having trouble iterating thru each of the squares. Im doing the NeetCode 150 on your website and I love that you have videos for each of the problems even if i get the right solution i look at your videos to see the alternative ways to solve it.

jesuscruz
Автор

This guy is more than just a legend :) He is THE legend!

mehdiezatabadi
Автор

I haven't seen that much easy explanation of all the code you explained. It helps me to improve my overall logical skills. Thanks Bud!!

parthvalani
Автор

This is the best channel in the whole of YouTube🔥

MP-nyep
Автор

What an explanation. I literally spend an entire day trying this problem and you explained me clearly within these few minutes. You are the best <3

AkshithaKukudala
Автор

I never thought in this question that tuple (r//3, c//3) could be keys for defaultdict. Amazing!

choiiohc
Автор

This solution is simply beautiful. You have my respect, Neetcode. <3

sayaksengupta
Автор

I'm here to say it NeetCode is all time top 1 teacher when it comes to explaining and solving algorithm and data structure problems. My guy is HIM!!!

akagamishanks
Автор

the best way to do this really, i had been struggling with this problem for a few days now, the sudoku solver really, i did the more complex way at first but i was worried that i would not be able to think of that solution in a coding test but this way is beautiful

reinventingdwheel
Автор

Idk how i'd ever figure this one out without watching a video. As always, thanks!

gogolaygo
Автор

Dude, seriously, this solution was so elegant and brilliant. Thanks, for explaining these things so simply and effectively.

AlanWeiler-cr
Автор

This makes my solution look like a crayon drawing of a 2-year-old. Awesome solution and well explained.

hamzaehsankhan
Автор

The way you explain this problem is brilliant man! So glad I found your channel

dnguyendev
Автор

The implementation for the squares with floor division and using a tuple as the key is simply amazing!

syafzal
Автор

I did it exactly the same way but I opted for just using 1 hashmap where the key was the number and the value was a tuple of (row, column, box number), then at every value I can just look up if it exists in the hashmap and compare each value in the tuple. I can't tell which solution would be better in terms of time complexity though since I would have to iterate all 3 values of my tuple after the constant lookup.

Myshio
Автор

Mind blown when you said you recorded on 4th of July!! It's been exactly one year! Thanks for everything you do

ramsesFPS
Автор

this problem should have been in the hard category instead of medium. but u explained it really well as always. thanks.

_dion_
Автор

I came to almost the same solution! Instead of using hash maps for the rows, columns, squares, I just initialized them as arrays of size 9 with a set at each position. Using defaultdict(set) is definitely a neat way to make the row, columns, squares sets.

FionaTraiton
join shbcf.ru