Minimum Time to Finish the Race | Leetcode 2188 | Contest 282 | DP | Knapsack problem 🔥🔥

  Рет қаралды 2,748

Coding Decoded

Coding Decoded

Күн бұрын

Пікірлер: 26
@himanshuchhikara4918
@himanshuchhikara4918 2 жыл бұрын
amazing explanation
@CodeWithSunchitDudeja
@CodeWithSunchitDudeja 2 жыл бұрын
Bhai Amazon k baad bhi... Kya baat hai
@hemantvardani1436
@hemantvardani1436 2 жыл бұрын
Really great question, great explanation !!!!
@daljeetsingh2566
@daljeetsingh2566 2 жыл бұрын
Great Solution bro!
@botron1187
@botron1187 2 жыл бұрын
Bro, i was pulling my hair to solve this problem and you are amazing bro.... thanks you so much for such a great explication
@CodeWithSunchitDudeja
@CodeWithSunchitDudeja 2 жыл бұрын
You are most welcome
@Venkatesh54629
@Venkatesh54629 2 жыл бұрын
@@CodeWithSunchitDudeja Could you please explain we what exactly we are doing in Math.Min(dp[i], dp[j] + changeTime + dp[i - j])
@MrHotfish88
@MrHotfish88 2 жыл бұрын
Amazing explanation🤯 thanks bro!🔥
@written_syntax
@written_syntax 2 жыл бұрын
🔥🔥
@theghostwhowalk
@theghostwhowalk 2 жыл бұрын
Thanks. With reference to formula on line 26, Dp[i] = min time to complete I+1 lapse right? When we change tire at j location, Why we have dp[j] + dp[i-j]+..
@eprohoda
@eprohoda 2 жыл бұрын
beautiful ~ taek care, =)
@avdd80
@avdd80 2 жыл бұрын
I'm struggling with Knapsack problems. Can you please point me to a couple of your past videos where you explain solutions to knapsack problems in detail?
@hoyinli7462
@hoyinli7462 2 жыл бұрын
same here. I have been watching this channel for quite a long time but I can't remember knapsack skills.
@hoyinli7462
@hoyinli7462 2 жыл бұрын
kzbin.info/www/bejne/ip6ZpZlvoLejb5I I guess this is the one. But is there more videos?
@CodeWithSunchitDudeja
@CodeWithSunchitDudeja 2 жыл бұрын
Thanks for sharing there is one more video kzbin.info/www/bejne/bpywoXaFntqUmMU
@nehagupta-op7si
@nehagupta-op7si 2 жыл бұрын
I think dp[i] = Minimum time to complete i loops instead of minimum time to complete ith loop
@amritanshu83
@amritanshu83 2 жыл бұрын
Could you please explain if (timeToCompleteLaps >2 ^17) break;
@hoyinli7462
@hoyinli7462 2 жыл бұрын
how about the time complexity? You used double loop from 1-1000. So the time complexity should be O(n^2) (n = numLaps)?
@CodeWithSunchitDudeja
@CodeWithSunchitDudeja 2 жыл бұрын
yes
@amritanshu83
@amritanshu83 2 жыл бұрын
Since we know we must change tyre in 18th lap could you please explain: dp[i]=i
@ShubhamGupta-qk9uq
@ShubhamGupta-qk9uq Жыл бұрын
More of a solution than explaination, please take some time to explain intuition even if you think it is obvious. Thanks
@bgmilover9784
@bgmilover9784 2 жыл бұрын
@Coding Decoded bro, i got everything but i am not clear about what exactly we are doing at line 26 (dp[i] = Math.Min(dp[i], dp[j] + changeTime + dp[i - j]);) could you please explain me this?
@jianpengyu9843
@jianpengyu9843 2 жыл бұрын
Nice explanation, but I don't quite understand nochange array. What happens if I stick with tire A for 3 laps and then change to tire B and stick with tire B for 4 laps?
@gauravkungwani
@gauravkungwani 2 жыл бұрын
till 5:00 you are only explaining the question, in a 11: 00 min video. Bro who comes to see the solution for this, has already understood the question. After that it is good. Try avoiding it.
@CodeWithSunchitDudeja
@CodeWithSunchitDudeja 2 жыл бұрын
Yes, I can reduce on this time but I do it explicitly so that all are on same page.
@blenderbottle382
@blenderbottle382 2 жыл бұрын
I don’t think I fully understood the withoutChange array. What does it represent? What does the ith index in that array mean?
How many people are in the changing room? #devil #lilith #funny #shorts
00:39
When Cucumbers Meet PVC Pipe The Results Are Wild! 🤭
00:44
Crafty Buddy
Рет қаралды 60 МЛН
I Solved 1583 Leetcode Questions  Here's What I Learned
20:37
ThePrimeTime
Рет қаралды 740 М.
Mastering Dynamic Programming - How to solve any interview problem (Part 1)
19:41
Making an Algorithm Faster
30:08
NeetCodeIO
Рет қаралды 151 М.
5 Simple Steps for Solving Any Recursive Problem
21:03
Reducible
Рет қаралды 1,2 МЛН
Big-O Notation - For Coding Interviews
20:38
NeetCode
Рет қаралды 518 М.
Dynamic Programming isn't too hard. You just don't know what it is.
22:31
DecodingIntuition
Рет қаралды 199 М.
Why is Python 150X slower than C?
10:45
Mehul - Codedamn
Рет қаралды 19 М.
How many people are in the changing room? #devil #lilith #funny #shorts
00:39