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

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

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
@shravsidol
@shravsidol Жыл бұрын
Great Explanation!
@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!
@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 😊
@chetan_bommu
@chetan_bommu 2 жыл бұрын
Very clean & crisp explanation 👏
@AlgorithmsMadeEasy
@AlgorithmsMadeEasy 2 жыл бұрын
Thanks!! Do share like and subscribe!!
@raushankumar6993
@raushankumar6993 2 жыл бұрын
great explaination
@AlgorithmsMadeEasy
@AlgorithmsMadeEasy Жыл бұрын
Glad you enjoyed it!
@tung-hsinliu861
@tung-hsinliu861 2 жыл бұрын
easy to understand explanation :)
@AlgorithmsMadeEasy
@AlgorithmsMadeEasy Жыл бұрын
Glad you enjoyed it!
@gauranshverma5962
@gauranshverma5962 3 жыл бұрын
great explanation and effort
@jaideeppyne1880
@jaideeppyne1880 2 жыл бұрын
Well explained with pictures!
@AlgorithmsMadeEasy
@AlgorithmsMadeEasy 2 жыл бұрын
Glad it was helpful! Don't forget to share and subscribe!!
@vaibhavaren3217
@vaibhavaren3217 3 жыл бұрын
Awesomely expalined. Thanks a ton :D :D
@AlgorithmsMadeEasy
@AlgorithmsMadeEasy 2 жыл бұрын
Glad it helped! Most welcome!! Don't forget to subscribe!!! :)
@krishnaveerakishoremuppana9189
@krishnaveerakishoremuppana9189 3 жыл бұрын
Thanks for the visualization :)
@manasawalaaamir
@manasawalaaamir 2 жыл бұрын
great explanation
@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.
@tusharnain6652
@tusharnain6652 2 жыл бұрын
Can't thank you enough.
@AlgorithmsMadeEasy
@AlgorithmsMadeEasy Жыл бұрын
Glad you enjoyed it!
@rahatsshowcase8614
@rahatsshowcase8614 2 жыл бұрын
very nice
@prasenjit_dutta
@prasenjit_dutta 3 жыл бұрын
Thankyou !!
@khawla2583
@khawla2583 3 жыл бұрын
Thank you for the video, would you provide us with explanation on how to print the coordinates of the shortest path ?
@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 🙂
@himanshunegi5228
@himanshunegi5228 3 жыл бұрын
crystal clear
@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
@anilkatakam2738
@anilkatakam2738 3 жыл бұрын
time limit exceeding
@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
@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.
@amruthaj4262
@amruthaj4262 7 ай бұрын
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.
@atharvakulkarni3007
@atharvakulkarni3007 3 жыл бұрын
mistake at 9:23 you've used 2,0 but on visualization you are on 0,2
@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.
@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?
Merge Two Binary Trees | Live Coding with Explanation | Leetcode - 617
25:53
Algorithms Made Easy
Рет қаралды 6 М.
ТВОИ РОДИТЕЛИ И ЧЕЛОВЕК ПАУК 😂#shorts
00:59
BATEK_OFFICIAL
Рет қаралды 6 МЛН
Ice Cream or Surprise Trip Around the World?
00:31
Hungry FAM
Рет қаралды 22 МЛН
Yay😃 Let's make a Cute Handbag for me 👜 #diycrafts #shorts
00:33
LearnToon - Learn & Play
Рет қаралды 117 МЛН
How Much Tape To Stop A Lamborghini?
00:15
MrBeast
Рет қаралды 235 МЛН
Longest String Chain | Live Coding with Explanation | Leetcode - 1048
13:43
Algorithms Made Easy
Рет қаралды 10 М.
Shortest Path in Binary Matrix | Live Coding with Explanation | Leetcode - 1091
10:23
Candy | Live Coding with Explanation | Leetcode -135
18:09
Algorithms Made Easy
Рет қаралды 14 М.
Pointers in C / C++ [Full Course]
3:47:23
freeCodeCamp.org
Рет қаралды 4,5 МЛН
Binary Tree Cameras | Live Coding with Explanation | Leetcode - 968
13:15
Algorithms Made Easy
Рет қаралды 10 М.
LeetCode 1293. Shortest Path in a Grid with Obstacles Elimination
18:53
ТВОИ РОДИТЕЛИ И ЧЕЛОВЕК ПАУК 😂#shorts
00:59
BATEK_OFFICIAL
Рет қаралды 6 МЛН