MINESWEEPER (Leetcode) - Code & Whiteboard

  Рет қаралды 9,991

babybear4812

babybear4812

Күн бұрын

An intuitive and not-too-verbose solution to Leetcode problem 529 - Minesweeper. As always, coded in Python with a whiteboard explanation, too :)
Let me know if you guys have any questions, and I'd be happy to address them!
leetcode.com/p...
---------------------------------------------------------------------------------------------------------------------------------------------------------------
Let's connect on LinkedIn!
/ aleksmitrovic
Follow me on Medium!
/ mitrovic.aleksandar
Questions or suggestions for new videos? Email me!
babybear4812@gmail.com

Пікірлер: 42
@UnknownName7950
@UnknownName7950 3 жыл бұрын
Hey man, I just came across your video. This is by far the best leetcode explanation I have ever seen. Great stuff man, keep it up!
@babybear-hq9yd
@babybear-hq9yd 3 жыл бұрын
I really appreciate that man, thank you so much 🙏
@Clipaholick
@Clipaholick 2 жыл бұрын
bro this is awesome, you kept us engaged, explained the solution super efficiently and kept a positive and enthusiastic attitude throughout the whole vid. Good shit man, u earned a sub!
@babybear-hq9yd
@babybear-hq9yd 2 жыл бұрын
Thanks a lot brotha I appreciate it!!!
@sumitvaise5452
@sumitvaise5452 21 күн бұрын
explanation is just amazing, thank you!
@babybear-hq9yd
@babybear-hq9yd 20 күн бұрын
my pleasure!
@snake1625b
@snake1625b 2 жыл бұрын
great video. this is an example of breadth-first search right?
@babybear-hq9yd
@babybear-hq9yd 2 жыл бұрын
from what I remember, I would say yes! :)
@sayeedchowdhury11
@sayeedchowdhury11 6 ай бұрын
I think it's DFS
@Cloud-577
@Cloud-577 2 жыл бұрын
again your explanation is just amazing, thank you! I never knew this is how you play the game lol
@babybear-hq9yd
@babybear-hq9yd 2 жыл бұрын
Hahah, the video was dual purpose. thanks buddy
@shilpabg2488
@shilpabg2488 3 жыл бұрын
Very well explained :) Thank you so much. Can you please explain the time complexity.
@Relqeds
@Relqeds 2 жыл бұрын
Thanks for uploading, very easy and well explanation. what will be time and space complexity ?
@babybear-hq9yd
@babybear-hq9yd 2 жыл бұрын
Thanks bud. A quick Google search on this told me it’s O(m*n), I’m a bit too rusty and hungover to verify but this smells about right 😂
@yukselpolatakbyk8468
@yukselpolatakbyk8468 2 жыл бұрын
After your amazing explanation this turned into a VERY EASY question. Thank you.
@babybear-hq9yd
@babybear-hq9yd 2 жыл бұрын
love it, that's what we aim for!!
@payamkhorramshahi5726
@payamkhorramshahi5726 3 жыл бұрын
Thank you for this video ! great explanation ! just one questions though. I feel like if in your first call you find mines around your node, it returns the board and wont go through the else statement where you have the recursive call. Please let me know if I am making a mistake
@babybear-hq9yd
@babybear-hq9yd 3 жыл бұрын
Hey Payam, yup that's exactly what happens! Although that's by design. Notice that in point 1 in the instructions tells us to change the cell to an 'X' and that the game is over. In the case of the first call being a mine, we'll label it appropriately, never enter the `else` statement, and return things as they are :)
@payamkhorramshahi5726
@payamkhorramshahi5726 3 жыл бұрын
@@babybear-hq9yd Thanks for replying :)
@sayeedchowdhury11
@sayeedchowdhury11 6 ай бұрын
Excellent video, subbed, keep it up
@babybear-hq9yd
@babybear-hq9yd 6 ай бұрын
thx man!
@udrush
@udrush 2 жыл бұрын
Hi, This is awesome and easy solution I found so far for this problem. Thanks a lot !
@amithkoutinagaraj5419
@amithkoutinagaraj5419 2 жыл бұрын
Can another condition be added during calling the recursive function, to check whether the next visiting block is not the number of mines?
@babybear-hq9yd
@babybear-hq9yd 2 жыл бұрын
we're only reaally checking to see if it's a mine or not. Not sure if checking for anything else would help us make the algo any faster
@billysapsford3439
@billysapsford3439 3 жыл бұрын
awesome! Love the visual whiteboarding!
@babybear-hq9yd
@babybear-hq9yd 3 жыл бұрын
Thanks Billy, I'll keep it coming :D
@nithinsastrytellapuri291
@nithinsastrytellapuri291 7 ай бұрын
Great explanation !
@babybear-hq9yd
@babybear-hq9yd 7 ай бұрын
thx bro
@bhushankhope8949
@bhushankhope8949 9 ай бұрын
what is the time and space complexity of this code?
@babybear-hq9yd
@babybear-hq9yd 9 ай бұрын
probably O(n*m) if i remember correctly
@prashantsikarwar3804
@prashantsikarwar3804 3 жыл бұрын
Thanks for the video. Great explanation. ✌️✌️
@vishnunandyala6037
@vishnunandyala6037 4 жыл бұрын
Thanks Man. Great Explanation
@babybear-hq9yd
@babybear-hq9yd 4 жыл бұрын
Thank you for the feedback! Glad I could help :)
@hisyamzayd
@hisyamzayd 2 жыл бұрын
Thank you, easy to understand..
@babybear-hq9yd
@babybear-hq9yd 2 жыл бұрын
Thx bud
@DailyGrindOfTech
@DailyGrindOfTech 2 жыл бұрын
appreciate you!
@hhjdkdnchidnd
@hhjdkdnchidnd 2 жыл бұрын
I hope you upload more video!!!!!
@babybear-hq9yd
@babybear-hq9yd 2 жыл бұрын
thanks anber! Maybe one day :)
@alokcom
@alokcom 3 жыл бұрын
I Just hate how coding interview has become like competitive exam like C.A.T , where the problems for coding has significance In real system design .
@vinoddiwan5792
@vinoddiwan5792 3 жыл бұрын
because it provides a job to many candidates unlike CAT (10K), IIT (10K), Bank (2K). Software developers millions
@andriidanylov9453
@andriidanylov9453 2 жыл бұрын
Appreciate.
NUMBER OF SHIPS IN A RECTANGLE (Leetcode) - Code & Whiteboard
28:30
babybear4812
Рет қаралды 4,9 М.
Making an Algorithm Faster
30:08
NeetCodeIO
Рет қаралды 119 М.
Сюрприз для Златы на день рождения
00:10
Victoria Portfolio
Рет қаралды 1,7 МЛН
RESTORE IP ADDRESSES (Leetcode) - Code & Whiteboard
23:40
babybear4812
Рет қаралды 3 М.
How I would learn Leetcode if I could start over
18:03
NeetCodeIO
Рет қаралды 600 М.
Whiteboard Coding Interviews: 6 Steps to Solve Any Problem
15:18
Fullstack Academy
Рет қаралды 373 М.
SHOPPER'S DELIGHT - IBM INTERVIEW QUESTION - Code & Whiteboard
22:33
I Solved 100 LeetCode Problems
13:11
Green Code
Рет қаралды 104 М.
COUNT UNHAPPY FRIENDS (Leetcode) - Code & Whiteboard
14:41
babybear4812
Рет қаралды 3,6 М.
Algorithms Explained for Beginners - How I Wish I Was Taught
17:38
Internet Made Coder
Рет қаралды 355 М.
Dear Game Developers, Stop Messing This Up!
22:19
Jonas Tyroller
Рет қаралды 719 М.
How I Failed the Google Coding Interview (and lessons I learned)
14:24