Path with Minimum Effort - Leetcode 1631 - Python

preview_player
Показать описание
Solving leetcode 1631, path with minimum effort, todays daily leetcode problem on september 15.

0:00 - Read the problem
0:30 - Drawing Explanation
6:11 - Coding Explanation

leetcode 1631

#neetcode #leetcode #python
Комментарии
Автор

You explain the thought process so understandably and in great detail that I don't even feel dumb anymore.

bundiderp
Автор

thanks neetcode, the question candy was asked in my interview...I saw ur video 😅 before the interview❤❤❤

criconicsbyme
Автор

thank you very much, this daily tasks are going harder and harder, needs new type of algorithms for me, union find, difikstra. I am glad to have you and you brilliant solutions with explanations. thank you

damirsharip
Автор

I solved this question myself, but I overcomplicated it, I built an adj list and traversed nodes using dijkstra's algorithm, but anyway, I proud I solved it myself, and huge part of this is you neetcode, thanks!

YT.Nikolay
Автор

How come you could solve it in such a brilliant way.
My first idea was to somehow use DFS. I wanted to go trough all possible routes and calculate the diff for them. And than return the min value. I wanted to do it with O (N ^ Infinity) time complexity, but This is amazing....

kirillzlobin
Автор

Could you please help me understand why we should use Djikstra algorithm here? I understand that we can use it here but how much faster will it be compared to the regular DFS with memoization storing the cost to reach (row - 1, col - 1) element?

dankiy
Автор

is line 12 needed, if we are already checking if the newR and newC are in visit? (lines 21)

jsdev
Автор

try to add these code and notes link in the discription please, would be very helpful

harmaina
Автор

Brilliant explanation as always = thank you so much and please continue🥰

sallaklamhayyen
Автор

how this comes to find min path we are trying to find max in every time?

alissabrave
Автор

instead of checking if the new row and new col is < 0 or == len(row)/len(row[0]) like you did in lines 20/21 you can just check if next_row in range(len(heights)) and next_col in range(len(heights[0])). Less text!

Raymond-Wu
Автор

Great video but I think the original and "corrected" time complexity is wrong. Can you explain how you came up with the "corrected" time complexity if you think it is correct?

schan
Автор

understood in one go excellent explaination, could you please solve leetcode 827 making large islands

prajjwaldubey
Автор

Thanks for amazing explanation. Do we need to check visit condition on line 22 as it’s checked on line 12 when popping?

StellasAdi
Автор

Can you please explain why a simple DFS method (without binary search) would not work to solve this problem? To me - all it seems to care about is the minimum absolute difference to get from 0, 0 to the bottom right corner cell. Would you say it is impossible to use a DFS method to solve this problem? If so - please elaborate on why.

SmoothCode
Автор

can you please explain the problem 403. Frog Jump . I'm stuck on it. I know how to start but somehow I get stuck and not able to reach the solution.

jesmigeorge
Автор

This looks very similar to the Prims algo, is it the same or is it different?

rohanchess
Автор

so bfs with a priority Q instead of normal Q?

gradientO
Автор

I hope we all recognise that this is too genius of a solution

faridahmed
Автор

is a heap required to solve this problem?

johnsoto
join shbcf.ru