Candy | Live Coding with Explanation | Leetcode -135

  Рет қаралды 14,767

Algorithms Made Easy

Algorithms Made Easy

Күн бұрын

Get Discount on GeeksforGeeks courses (practice.geeks...) by using coupon code: ALGOMADEASY
To support us you can donate
UPI: algorithmsmadeeasy@icici
Paypal: paypal.me/algorithmsmadeeasy
Check out our other popular playlists:
Questions you might like:
✅✅✅[ Tree Data Structure] : • Tree Data Structure
✅✅✅[ Graphs Data Structure] : • Graph Data Structure
✅✅✅[ February Leetcoding Challenge] : • February Leetcoding Ch...
✅✅✅[ January Leetcoding Challenge] : • January Leetcoding Cha...
✅✅✅[ February Leetcoding Challenge] : • February Leetcoding Ch...
✅✅✅[ March Leetcoding Challenge] : • March Leetcoding Chall...
✅✅✅[ December Leetcoding Challenge] : • December Leetcoding Ch...
✅✅✅[ November Leetcoding Challenge] : • November Leetcoding Ch...
✅✅✅[ August Leetcoding Challenge] : • August LeetCoding Chal...
✅✅✅[ July Leetcoding challenges] : • July LeetCoding Challe...
✅✅✅[ June Leetcoding challenges] : www.youtube.co...
✅✅✅[ May Leetcoding challenges] : • May LeetCoding Challen...
✅✅✅ Cracking the Coding Interview - Unique String: • Cracking the Coding In...
Problem Link: leetcode.com/p...
Code: github.com/Alg...
If you find any difficulty or have any query then do COMMENT below. PLEASE help our channel by SUBSCRIBING and LIKE our video if you found it helpful.
#coding #leetcode #programminglife #programmingisfun #programmer #tech #software #codinglife #leetcode

Пікірлер: 32
@AlgorithmsMadeEasy
@AlgorithmsMadeEasy 3 жыл бұрын
We hope you all are enjoying our videos!!! Don't forget to leave a comment!!! Please like the video to support us!!! Questions you might like: ✅✅✅[ Tree Data Structure] : kzbin.info/aero/PLJtzaiEpVo2zx-rCqLMmcFEpZw1UpGWls ✅✅✅[ Graphs Data Structure] : kzbin.info/aero/PLJtzaiEpVo2xg89cZzZCHqX03a1Vb6w7C ✅✅✅[ January 2021 Leetcoding Challenge] : kzbin.info/aero/PLJtzaiEpVo2wCalBcRcNjXQ0C6ku3dRkn ✅✅✅[ February 2021 Leetcoding Challenge] : kzbin.info/aero/PLJtzaiEpVo2wrfvII0eZQsPm-MZCmHodm ✅✅✅[ March 2021 Leetcoding Challenge] : kzbin.info/aero/PLJtzaiEpVo2zH-YC5ZiptbAvw2QZkmyk9 ✅✅✅[ April 2021 Leetcoding Challenge] :kzbin.info/aero/PLJtzaiEpVo2z9PpcJcsl5j3RXutiTU-GB ✅✅✅[ December 2020 Leetcoding Challenge] : kzbin.info/aero/PLJtzaiEpVo2xo8OdPZxrpybGR8FmzZpCA ✅✅✅[ November 2020 Leetcoding Challenge] : kzbin.info/aero/PLJtzaiEpVo2yMYz5RPH6pfB0wNnwWsK7e ✅✅✅[ August 2020 Leetcoding Challenge] : kzbin.info/aero/PLJtzaiEpVo2xu4h0gYQzvOMboclK_pZMe ✅✅✅[ July 2020 Leetcoding challenges] : kzbin.info/aero/PLJtzaiEpVo2wrUwkvexbC-vbUqVIy7qC- ✅✅✅[ June 2020 Leetcoding challenges] : kzbin.info/aero/PLJtzaiEpVo2xIPptnCvUtKrUcod2zAKG ✅✅✅[ May 2020 Leetcoding challenges] : kzbin.info/aero/PLJtzaiEpVo2wRmUCq96zsUwOVD6p66K9e ✅✅✅ Cracking the Coding Interview - Unique String: kzbin.info/aero/PLJtzaiEpVo2xXf4LZb3y_BopOnLC1L4mE Struggling in a question?? Leave in a comment and we will make a video!!!🙂🙂🙂
@mr.streetwear506
@mr.streetwear506 3 жыл бұрын
Thank you so much for the second approach, I was not able to grab it but after this video its crystal clear.
@aswathis5902
@aswathis5902 4 ай бұрын
I actually fed up by not understanding the approach of left and right but unexpectedly i came across your video and now i got the idea 😻 its really helpful tqsm bro❤
@strawberriesandcream2863
@strawberriesandcream2863 Жыл бұрын
was looking for a video explanation of the slope approach. thanks!!
@ragingpahadi
@ragingpahadi 3 жыл бұрын
Mountain Solution Explanation is Ultimate ! Aap ko koti koti pranam : ]
@AlgorithmsMadeEasy
@AlgorithmsMadeEasy 3 жыл бұрын
Thanks !!
@praveenj3112
@praveenj3112 3 жыл бұрын
Glad to know that second approach . Thank you so much
@AlgorithmsMadeEasy
@AlgorithmsMadeEasy 3 жыл бұрын
Happy to help!!
@atifhu
@atifhu 2 жыл бұрын
No doubt the explanation was great, but it feels like you explained just the pattern for this question but not the inutition behind it, how and why this is greedy, and why we are getting answer. Though I appreciate for all the efforts.
@AlgorithmsMadeEasy
@AlgorithmsMadeEasy Жыл бұрын
Good point. We will try not to repeat that in future videos.
@sufyan2317
@sufyan2317 2 жыл бұрын
Graph approach clearly explained here.
@rupakkorde
@rupakkorde 3 жыл бұрын
Mountain solution is awesome Thanks a lot for covering it.
@AlgorithmsMadeEasy
@AlgorithmsMadeEasy 3 жыл бұрын
Thanks !!
@madanmohanpachouly6135
@madanmohanpachouly6135 2 жыл бұрын
​@@AlgorithmsMadeEasy How to come up with mountain intuition in Interview , if not seen the problem before :-(.
@PeterParker-tp6gm
@PeterParker-tp6gm 10 ай бұрын
Perfect explanation 🔥🔥⚡️
@piyush814
@piyush814 3 жыл бұрын
I didn't understand the 2nd solution clearly. But thanks for explaining. Others are just explaining the 1st solution only
@rajvidesai3352
@rajvidesai3352 2 жыл бұрын
Best explanation, I just loved it !
@andressalazargaleano6419
@andressalazargaleano6419 3 жыл бұрын
great explaination
@AlgorithmsMadeEasy
@AlgorithmsMadeEasy 3 жыл бұрын
Thanks !!
@pramodhk2702
@pramodhk2702 2 жыл бұрын
Ma'am could you pls explain the intuition behind the second approach? Great explanation though. Thanks
@tianzhengmai1369
@tianzhengmai1369 Жыл бұрын
Sorry, could you explain the logic of the equation "candies = sum(up) + sum(down) + Max(up, down)"
@nishantgarg2815
@nishantgarg2815 2 жыл бұрын
why is Max(up, down) added ?
@riamonga2283
@riamonga2283 2 жыл бұрын
How do we get the intuition for the second approach and THE FORMULA used in it? Great content tho! Thank you 🙌🙌🔥
@shubhamlahoti9758
@shubhamlahoti9758 3 жыл бұрын
Why are we adding 1 in the second last line?
@AlgorithmsMadeEasy
@AlgorithmsMadeEasy 3 жыл бұрын
Because we need the data for the last mountain without skipping any point. So we take the sum of 1 to n for up and down slopes plus we add the peak which is going to be 1 greater than the point given to the max(up, down) Sum(up) + sum(down) + peak Where, peak is max(up,down) + 1 In the part inside the loop, we skip the last point of the valley so we subtract 1 from the outer formula that cancels out the +1. And we get the inner loop formula. Sum(up) + sum(down) + peak - 1 Where, peak is max(up,down) + 1 So the consolidated formula becomes Sum(up) + sum(down) + max(up, down) Hope this helps.
@shubhamlahoti9758
@shubhamlahoti9758 3 жыл бұрын
@@AlgorithmsMadeEasy Thank you so much for the detailed explanation! The implementation was quite tricky but you made it seem like a cakewalk :)
@AlgorithmsMadeEasy
@AlgorithmsMadeEasy 3 жыл бұрын
Happy to help !!
@rhythmbhatia8906
@rhythmbhatia8906 2 жыл бұрын
@@AlgorithmsMadeEasy Please try to explain the formula in the video itself! If we have to read text, then we would have visited the Discuss section itself!
@pranavsharma7361
@pranavsharma7361 2 жыл бұрын
What about slope like /\
@chaitanyakrishna7750
@chaitanyakrishna7750 3 жыл бұрын
I know the java basics For understanding this program What I need to learn first 🥇 Anyone pls 🙏 I didn't understanding time complexity and space complexity what it is? and more dp[].. So pls suggest to learn.. ☺
@AlgorithmsMadeEasy
@AlgorithmsMadeEasy 3 жыл бұрын
The first chapter in any DSA book is always on Complexity Analysis. Start with that. You can refer to the sequence in book DSA made Easy By Narsimha Karumanchi or from Cracking the coding interview.
@venkatasriharsha4227
@venkatasriharsha4227 3 жыл бұрын
My suggestion is to get strong with basics and then understand time and space complexities. Solve array and loop based problems to get better logically then start with recursions, DSA and DP problems. Practice solving in leetcode and hackerrank. Hope this helps :D Happy learning
Candy - Leetcode 135 - Python
13:45
NeetCodeIO
Рет қаралды 34 М.
Course Schedule III | Live Coding with Explanation | Leetcode - 630
13:38
Algorithms Made Easy
Рет қаралды 11 М.
It’s all not real
00:15
V.A. show / Магика
Рет қаралды 12 МЛН
Beat Ronaldo, Win $1,000,000
22:45
MrBeast
Рет қаралды 144 МЛН
Don’t Choose The Wrong Box 😱
00:41
Topper Guild
Рет қаралды 52 МЛН
How to Solve ANY LeetCode Problem (Step-by-Step)
12:37
Codebagel
Рет қаралды 314 М.
Making an Algorithm Faster
30:08
NeetCodeIO
Рет қаралды 166 М.
Jump Game II | Live Coding with Explanation | Leetcode - 45
9:38
Algorithms Made Easy
Рет қаралды 26 М.
Dynamic Programming isn't too hard. You just don't know what it is.
22:31
DecodingIntuition
Рет қаралды 205 М.
I Solved 100 LeetCode Problems
13:11
Green Code
Рет қаралды 269 М.
Reverse Nodes in k-Group O(1) | Live Coding with Explanation | Leetcode - 25
15:25
I gave 127 interviews. Top 5 Algorithms they asked me.
8:36
Sahil & Sarra
Рет қаралды 678 М.
Binary Tree Cameras | Live Coding with Explanation | Leetcode - 968
13:15
Algorithms Made Easy
Рет қаралды 11 М.
It’s all not real
00:15
V.A. show / Магика
Рет қаралды 12 МЛН