Leetcode Triangle 120 || Code + Explanation + Examples || Dynamic Programming

  Рет қаралды 8,681

Code with Alisha

Code with Alisha

Күн бұрын

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...

Пікірлер: 23
@madhuryadav2424
@madhuryadav2424 Жыл бұрын
Was trying to do this problem since morning finally got the right approach Thanks.
@kartikeyasaxena4826
@kartikeyasaxena4826 Жыл бұрын
your solutions are pretty maam, no wonder i got them from this channel
@reshmaparveen6679
@reshmaparveen6679 3 жыл бұрын
Tq ma'am my son continue watching ❤️❤️❤️
@haltersweb
@haltersweb Жыл бұрын
Clearly presented. Helped me tremendously. Thanks!
@saravanans9355
@saravanans9355 2 ай бұрын
Thanks 🎉🎉
@ayushranjan5535
@ayushranjan5535 2 жыл бұрын
amazing explanation
@reshmaparveen6679
@reshmaparveen6679 3 жыл бұрын
Ma'am u r in IIT Bombay
@ashokdurunde1814
@ashokdurunde1814 2 жыл бұрын
thank you for your explanation . I get little idea about dp
@Bobby-mf6fw
@Bobby-mf6fw 2 жыл бұрын
Great work mam 👍
@ishikabaliyan41
@ishikabaliyan41 Жыл бұрын
it will be dp[j] not dp[i] in last foor loop
@ravikant1756
@ravikant1756 Жыл бұрын
thank you 🙏
@RameshGaridapuri
@RameshGaridapuri 4 ай бұрын
Grady approach wont satires all test cases , bettter go with dinamic programming
@tanyagupta4247
@tanyagupta4247 2 жыл бұрын
thanks for the explanation
@062_yatinnagpal2
@062_yatinnagpal2 2 жыл бұрын
Nice Explanation❤
@AmitKumar-hr3pc
@AmitKumar-hr3pc 2 жыл бұрын
nice explanation.
@mohdshahzad7371
@mohdshahzad7371 2 жыл бұрын
Thanks ma'am
@subashpalanivel8476
@subashpalanivel8476 2 жыл бұрын
Wonderful ✨✨
@karthikmr1855
@karthikmr1855 3 жыл бұрын
thankyou mam for detailed explanation!!
@suyashphatak9902
@suyashphatak9902 3 жыл бұрын
Linkedin profile ?
@pironobcoding
@pironobcoding 2 жыл бұрын
nic soln thx
@vivekgupta6696
@vivekgupta6696 2 жыл бұрын
today this videoo will have more comments than before , i am seeing 8 comments , 868 views lets see at the end of the day
@maddycoder1294
@maddycoder1294 9 ай бұрын
just wow
@ananyagoel512
@ananyagoel512 2 жыл бұрын
amazing explanation
Triangle - Dynamic Programming made Easy - Leetcode 120
15:06
Spongebob ate Patrick 😱 #meme #spongebob #gmod
00:15
Mr. LoLo
Рет қаралды 21 МЛН
Every parent is like this ❤️💚💚💜💙
00:10
Like Asiya
Рет қаралды 20 МЛН
Career Advice For A World After AI
23:07
Varun Mayya
Рет қаралды 222 М.
330. Patching Array | Greedy | Array | Math | Why not Bitset Trick
23:19
Triangle | Live Coding with Explanation | Leetcode - 120
11:07
Algorithms Made Easy
Рет қаралды 7 М.
I Solved 100 LeetCode Problems
13:11
Green Code
Рет қаралды 67 М.
How I would learn Leetcode if I could start over
18:03
NeetCodeIO
Рет қаралды 569 М.
LeetCode was HARD until I Learned these 15 Patterns
13:00
Ashish Pratap Singh
Рет қаралды 403 М.
Spongebob ate Patrick 😱 #meme #spongebob #gmod
00:15
Mr. LoLo
Рет қаралды 21 МЛН