Leetcode Triangle 120 || Code + Explanation + Examples || Dynamic Programming
ฝัง
- เผยแพร่เมื่อ 4 ต.ค. 2024
- Given a triangle array, return the minimum path sum from top to bottom.
For each step, you may move to an adjacent number of the row below. More formally, if you are on index i on the current row, you may move to either index i or index i + 1 on the next row.
Example 1:
Input: triangle = [[2],[3,4],[6,5,7],[4,1,8,3]]
Output: 11
Explanation: The triangle looks like:
2
3 4
6 5 7
4 1 8 3
The minimum path sum from top to bottom is 2 + 3 + 5 + 1 = 11 (underlined above).
Example 2:
Input: triangle = [[-10]]
Output: -10
LInk to challenge: leetcode.com/p...
Was trying to do this problem since morning finally got the right approach
Thanks.
your solutions are pretty maam, no wonder i got them from this channel
Tq ma'am my son continue watching ❤️❤️❤️
Clearly presented. Helped me tremendously. Thanks!
Thanks 🎉🎉
amazing explanation
Ma'am u r in IIT Bombay
thank you for your explanation . I get little idea about dp
Great work mam 👍
thank you 🙏
it will be dp[j] not dp[i] in last foor loop
Grady approach wont satires all test cases , bettter go with dinamic programming
thanks for the explanation
Thanks ma'am
Linkedin profile ?
Nice Explanation❤
nic soln thx
nice explanation.
Wonderful ✨✨
just wow
thankyou mam for detailed explanation!!
today this videoo will have more comments than before , i am seeing 8 comments , 868 views lets see at the end of the day
amazing explanation