Leetcode - Path With Minimum Effort (Python)

preview_player
Показать описание
January 2021 Leetcode Challenge
Leetcode - Path With Minimum Effort #1631
Рекомендации по теме
Комментарии
Автор

1337 af. Thank you for sharing this, great explanation.

xvzf
Автор

If I can't solve the problem, first thing I check if you have a video that covers it, if no then check Leetcode discussion and Hope I will get how solution works

almasabdrazak
Автор

why not push the max(new_k, k) instead of "new_k"

paradox
Автор

the same (r, c) could be push to the heap several times, if you have a big matrix where every node/cell have the same "height" but the target (matrix[-1][-1]) has a higher value it could be a issue...or am I missing something?
a dictionary (node_cost) could be use to track the cost of each node (r, c), so only (r, c) with lower cost are push to the heap

networking_coding_else
Автор

You definitely knows more than me! Thanks!

ChanChan-pgwu
Автор

Hi, just wondering why mn starts at -1 instead of 0

chrisshao
welcome to shbcf.ru