Shortest Path in a Grid with Obstacles Elimination | Leetcode 1293 | Live coding session 🔥🔥🔥

preview_player
Показать описание
Here is the solution to "Shortest Path in a Grid with Obstacles Elimination" leetcode question. Hope you have a great time going through it.

1) 0:00 Explaining the problem out loud
2) 1:10 Algorithm walkthrough
3) 2:00 Solution approach
4) 12:00 Coding

For discussion/feedback

PS : Please increase the speed to 1.25X
Рекомендации по теме
Комментарии
Автор

Yeah this was the error....I was only traversing the cell once...and so 45/47 test cases passed

Thanks⚡

Ryan-mrpn
Автор

Can we drop the visited array and rather just mark visited nodes as -1 in grid itself ?

tejasnakhate
Автор

Hi, first of all a million thanks for daily videos. These are really informative and helpful. It would be great if you spend a minute on explaining time and space complexity for every question.

varunrmishra
Автор

Please start making editorial of weekly contest

Sksahu_
Автор

This is quite similar how much time required to infect all cells question

satyajeetdas
Автор

What will be the time complexity of this approach ?

snehalkumar.singh.cse
Автор

isn't adding the new obstacle entry once to the queue sufficient, even adding two entries wouldn't we be processing same data twice?

abhishekahlawat
Автор

Have a question please: Why are there two while loops? In another words, why return level and not the number of steps(pushes to queue).
I did try to remove the inner while loop and the returned number obviously shooted up.

vahidsaber
Автор

watched many videos...finally got the point I was missing...please keep making videos with such clear cut explanations. Thankyou :)

kannupriyarana
Автор

Equal Sum Arrays With Minimum Number of Operations ... please EXPlAIN THIS QUESTION SIR

PJ-flyk
Автор

Can you please share your leetcode profile link here.

vikramkirubaharan
Автор

Awesome Explanation. I cannot clear this doubt why DFS won't work in this case?

Coolharshit
Автор

What if we find out that a better path to an older co-ordinate is obtained later but they are not immediate neighbours?
Wouldn't we perform a cascade of some sort or reiterate to ensure that?

MGtvMusic
Автор

how do you solve it man!
I spent more than 1 hour just understanding the problem.. but didnt even find a way to solve it..
Its more than 2 months im solving problems on daily basis....i can understand the flow after watching any reference but i cant do it on my own... every time i am failing in technical assesments of companies..cant even solve 1 problem which seems very i refer online for the same problem i can understand it in a minute, but thats no
Without watching any reference/hints im unable to solve any kind problem on my own... this is literally more than frustation level.. 😥

noobcreations
Автор

Suppose we reach a cell where one path has distance 3 and lives 0, other path has distance 5 and lives 3 . You will update the path with later but what if 1st path reach the end with shorted path?

Thepankaz
Автор

waiting for todays video, its a hard hard question

LegitGamer
welcome to shbcf.ru