Shortest Path in a Grid with Obstacles Elimination | Live Coding with Explanation | Leetcode - 1293

  Рет қаралды 16,387

Algorithms Made Easy

Algorithms Made Easy

Күн бұрын

Пікірлер: 57
@geek_for_life
@geek_for_life 2 жыл бұрын
Thank you for Explaining it in Crystal Clear Manner! 👍
@AlgorithmsMadeEasy
@AlgorithmsMadeEasy Жыл бұрын
Glad it was helpful!
@BruceyBit
@BruceyBit Жыл бұрын
Great explanation! The graphics are extremely helpful!❤
@AlgorithmsMadeEasy
@AlgorithmsMadeEasy Жыл бұрын
Glad it was helpful!
@praveenugiri
@praveenugiri 2 жыл бұрын
Good Intuition, thanks
@AlgorithmsMadeEasy
@AlgorithmsMadeEasy Жыл бұрын
You are so welcome
@pradiptalekar7545
@pradiptalekar7545 3 жыл бұрын
Good one. Easy to understand and easy to implement. Thanks for sharing!!
@shraddhashah7312
@shraddhashah7312 Жыл бұрын
Excellent explanation. Thank you👏
@hiss30
@hiss30 2 жыл бұрын
Thank you,I found this very helpful😊
@AlgorithmsMadeEasy
@AlgorithmsMadeEasy Жыл бұрын
Glad it was helpful!
@chetan_bommu
@chetan_bommu 2 жыл бұрын
Very clean & crisp explanation 👏
@AlgorithmsMadeEasy
@AlgorithmsMadeEasy 2 жыл бұрын
Thanks!! Do share like and subscribe!!
@tung-hsinliu861
@tung-hsinliu861 2 жыл бұрын
easy to understand explanation :)
@AlgorithmsMadeEasy
@AlgorithmsMadeEasy Жыл бұрын
Glad you enjoyed it!
@shravsidol
@shravsidol Жыл бұрын
Great Explanation!
@raushankumar6993
@raushankumar6993 2 жыл бұрын
great explaination
@AlgorithmsMadeEasy
@AlgorithmsMadeEasy Жыл бұрын
Glad you enjoyed it!
@utkarshsharma1185
@utkarshsharma1185 2 жыл бұрын
thanks, mam your memoization approach is excellent and very intuitive compared to other methods like storing the count of k in the visited array to decide whether we should traverse this cell or not.
@AlgorithmsMadeEasy
@AlgorithmsMadeEasy Жыл бұрын
Most welcome 😊
@gauranshverma5962
@gauranshverma5962 3 жыл бұрын
great explanation and effort
@vaibhavaren3217
@vaibhavaren3217 3 жыл бұрын
Awesomely expalined. Thanks a ton :D :D
@AlgorithmsMadeEasy
@AlgorithmsMadeEasy 2 жыл бұрын
Glad it helped! Most welcome!! Don't forget to subscribe!!! :)
@jaideeppyne1880
@jaideeppyne1880 2 жыл бұрын
Well explained with pictures!
@AlgorithmsMadeEasy
@AlgorithmsMadeEasy 2 жыл бұрын
Glad it was helpful! Don't forget to share and subscribe!!
@krishnaveerakishoremuppana9189
@krishnaveerakishoremuppana9189 3 жыл бұрын
Thanks for the visualization :)
@manasawalaaamir
@manasawalaaamir 2 жыл бұрын
great explanation
@khawla2583
@khawla2583 3 жыл бұрын
Thank you for the video, would you provide us with explanation on how to print the coordinates of the shortest path ?
@tusharnain6652
@tusharnain6652 2 жыл бұрын
Can't thank you enough.
@AlgorithmsMadeEasy
@AlgorithmsMadeEasy Жыл бұрын
Glad you enjoyed it!
@rahatsshowcase8614
@rahatsshowcase8614 2 жыл бұрын
very nice
@rjkal
@rjkal 2 жыл бұрын
Very good explanation, better than most I've seen for this problem. I have one question - how do you know when to increment the step? I am trying to understand how you determine that? Also you mentioned for the 3D array it is [i, j, k+1]. Why k + 1? Please help me understand.
@muhammadrehanalikhan1453
@muhammadrehanalikhan1453 2 жыл бұрын
Q "how do you know when to increment the step?" look at the inner while loop "while(size-- > 0) { }" you just need to count how many times this while loop is been called. First Call: the 'while loop' will process cell (0,0) and terminate Second Call: the 'while loop' will process all cells ONE step away from (0,0) Third Call: the loop will process all cells TWO steps away from (0,0).......AND SO ON that means number of while loop calls == number of steps taken. That is why she is incrementing step outside the end of this inner while loop. Q "Also you mentioned for the 3D array it is [i, j, k+1]. Why k + 1?" we are using k as one of the index of the visited array. An array of size == k has max index of k - 1. So we make the size == k + 1 so the max index is k. I hope this helps.
@rjkal
@rjkal 2 жыл бұрын
@@muhammadrehanalikhan1453 Thank you so much for the detailed explanation! That cleared my doubt. It is really helpful.
@prasenjit_dutta
@prasenjit_dutta 3 жыл бұрын
Thankyou !!
@noobCoder26
@noobCoder26 2 жыл бұрын
can i take vis[m][n ] instead of vis[m][n][k]? I didnt get the point of 3d array ie K
@kartikeykhosla8737
@kartikeykhosla8737 3 жыл бұрын
One video on leetcode 73, ur's explanations are easy to understand
@AlgorithmsMadeEasy
@AlgorithmsMadeEasy 2 жыл бұрын
Surely we will try to create a video on that... Keep sharing problems you wish to see videos on.
@himanshunegi5228
@himanshunegi5228 3 жыл бұрын
crystal clear
@atharvakulkarni3007
@atharvakulkarni3007 3 жыл бұрын
mistake at 9:23 you've used 2,0 but on visualization you are on 0,2
@jainamshah3691
@jainamshah3691 Жыл бұрын
When i am optimizing more by using distance matrix, why its giving wrong answer I am not able to understand that can you please explain I am using distance matrix like if the neighbour distance is already less than 1 + steps then i will not push it to the queue
@anilkatakam2738
@anilkatakam2738 3 жыл бұрын
time limit exceeding
@venkatasriharsha4227
@venkatasriharsha4227 3 жыл бұрын
I love the way u explain things. I don't know much about Java but I can clearly code it in python after seeing your explanation. Keep it up. You need more subscribers 😔 They're missing alot. I'll recommend it to my frnds from my side as a small gratitude. Make videos as frequently as possible 🙂
@giangkhuat9343
@giangkhuat9343 3 жыл бұрын
hey does anyone know why we don't need to take into account the distance(number of steps) when checking if the current cell is visited ? we only need three elements ?
@adarshkesarwani3384
@adarshkesarwani3384 2 жыл бұрын
we are just interested in finding weather a particular cell is visited or not, how does it even matter at what step a particular cell got visited, we just if it is visited or not irrespective of steps count.
@amruthaj4262
@amruthaj4262 8 ай бұрын
Why should we take k+1 not just 'k' in the visited array? The code doesn't work if it's just k....I didn't understand this. Please explain.
@saunaknandi1814
@saunaknandi1814 2 жыл бұрын
I used 3D - DP but its not working and giving stack overflow but why?
@sarthakkumar856
@sarthakkumar856 2 жыл бұрын
I have also used 3D-DP using recusion but I am getting wrong answer on 46th test case.
@shashanksingh4708
@shashanksingh4708 2 жыл бұрын
is this multi source bfs ?
@raj2523
@raj2523 2 жыл бұрын
Nope
@shubamgoswami
@shubamgoswami 2 жыл бұрын
study material folder💦
@yalslaus
@yalslaus 2 жыл бұрын
9:30 is wrong. you should be at (2,0)
@budsyremo
@budsyremo 2 жыл бұрын
Can there be a scenario where there are two paths and one path is longer ? And if so what if the longer path shws up first ?
@avinashchoubey3394
@avinashchoubey3394 2 жыл бұрын
longer path can never show up first in BFS. BFS traverses with one length increment in path so the shorter path is always processed first
@sakshimishra1491
@sakshimishra1491 2 жыл бұрын
not optimized. optimize before uploading it on youtube. don't dump anything and everything.
@ThisisCuriousclue
@ThisisCuriousclue 2 жыл бұрын
rubbish
@Shanky_17
@Shanky_17 2 жыл бұрын
what and how?
Longest String Chain | Live Coding with Explanation | Leetcode - 1048
13:43
Algorithms Made Easy
Рет қаралды 10 М.
Creative Justice at the Checkout: Bananas and Eggs Showdown #shorts
00:18
Fabiosa Best Lifehacks
Рет қаралды 35 МЛН
The evil clown plays a prank on the angel
00:39
超人夫妇
Рет қаралды 44 МЛН
Shortest Path in Binary Matrix | Live Coding with Explanation | Leetcode - 1091
10:23
LAVROV's interview with Tucker CARLSON 😁 [Parody]
8:34
Юрий ВЕЛИКИЙ
Рет қаралды 308 М.
I Solved 100 LeetCode Problems
13:11
Green Code
Рет қаралды 269 М.
Candy | Live Coding with Explanation | Leetcode -135
18:09
Algorithms Made Easy
Рет қаралды 14 М.
Making an Algorithm Faster
30:08
NeetCodeIO
Рет қаралды 166 М.
How I Mastered Data Structures and Algorithms in 8 Weeks
15:46
Aman Manazir
Рет қаралды 124 М.
Binary Tree Cameras | Live Coding with Explanation | Leetcode - 968
13:15
Algorithms Made Easy
Рет қаралды 11 М.
Creative Justice at the Checkout: Bananas and Eggs Showdown #shorts
00:18
Fabiosa Best Lifehacks
Рет қаралды 35 МЛН