502. IPO | Greedy | Priority Queue | Sorting

  Рет қаралды 4,274

Aryan Mittal

Aryan Mittal

Күн бұрын

In this video, I'll talk about how to solve Leetcode 502. IPO | Greedy | Priority Queue | Sorting | Zeta | Salesforce | Amazon
How to balance College & CP - • How to Balance ⚖️ Codi...
Let's Connect:
📱Discord (Join Community) : / discord
📝Linkedin: / aryan-mittal-0077
📸 Instagram: / codewitharyanbhai
💻 Twitter - / aryan_mittal007
🤖 Github: github.com/ary...
About Me:
I am Aryan Mittal - A Software Engineer in Goldman Sachs, Speaker, Creator & Educator. During my free time, I create programming education content on this channel & also how to use that to grow :)
✨ Timelines✨
✨ Hashtags ✨
#programming #Interviews #leetcode #faang #maang #datastructures #algorithms

Пікірлер: 38
@ARYANMITTAL
@ARYANMITTAL 3 ай бұрын
How to balance College & CP - kzbin.info/www/bejne/bWrVqYlomZ1prdk
@aishwaryasuresh3610
@aishwaryasuresh3610 2 ай бұрын
This s such a great explanation, starting from why dp and going in the direction of dp and why we cant do dp. Incredible.
@shivendrasingh8520
@shivendrasingh8520 3 ай бұрын
atleast pehle question to dhire dhire batao bhai
@arcade320
@arcade320 3 ай бұрын
Please Explain like this only today i easily understand what you are trying to explain otherwise i can't get what you try mostly...please explain like this only each and every thing should be crystal clear..Thankyou Aryan
@parthtammiwar8609
@parthtammiwar8609 3 ай бұрын
he always explains clearly,maybe you are 😮‍💨
@arcade320
@arcade320 3 ай бұрын
@@parthtammiwar8609 yeah i am dumb not smart as you , you could be a scientist in NASA in future , get lost i have't asked for your advice . BE careful from next time okay ? stupid??
@arcade320
@arcade320 3 ай бұрын
@@parthtammiwar8609 shut up get lost
@shrutivvv
@shrutivvv 3 ай бұрын
Amazing explanation...pls explain like this only..❤
@iamnoob7593
@iamnoob7593 3 ай бұрын
Aryan man , This is beautiful explanation.
@TON-108
@TON-108 3 ай бұрын
42k ❤‍🔥
@shivendrasingh8520
@shivendrasingh8520 3 ай бұрын
bhai thoda dhire bol dete.... plz
@anubhavdeepankar6681
@anubhavdeepankar6681 3 ай бұрын
can we say priority queue will be of size : at max size k ? , just an observation
@sanebrain3083
@sanebrain3083 3 ай бұрын
3:19 if you have already understood the question , the solution begins her
@parthtammiwar8609
@parthtammiwar8609 3 ай бұрын
bro can you please upload gfg potd ,it would be a great help,as your explanation skill are aweasom
@vageshnp6792
@vageshnp6792 3 ай бұрын
tq
@Flynn-lk8im
@Flynn-lk8im 3 ай бұрын
What makes this different from the typical knapsack problem so that we don't apply DP?
@6mahine_mein_google
@6mahine_mein_google 3 ай бұрын
look at constraints
@AnordinaryMan007
@AnordinaryMan007 3 ай бұрын
I was thinking in the direction of profit then but capital is more important their
@naamnhibataunga5897
@naamnhibataunga5897 3 ай бұрын
brother can you please make a video explaining question 128.. using this solution:- class Solution { public: int longestConsecutive(vector& nums) { unordered_map m; int r = 0; for (int i : nums) if (!m[i]) { m[i] = m[i - 1] + m[i + 1] + 1; m[i - m[i - 1]] = m[i]; m[i + m[i + 1]] = m[i]; r = max(r, m[i]); } return r; } }; i am still not able to understand it.
@GYANKIBAAT-ze7nd
@GYANKIBAAT-ze7nd 3 ай бұрын
Aryan can you why can't we apply DP here?
@6mahine_mein_google
@6mahine_mein_google 3 ай бұрын
it will give TLE as u have to keep track of k and current capital .. TC of dp solution will be 1e14 and you can do it only after sorting the capital,profit array... from there we got greedy solution idea
@Anonymous____________A721
@Anonymous____________A721 3 ай бұрын
Sir Why not sorting with profit-capital value
@prashantsahu5117
@prashantsahu5117 3 ай бұрын
because we will loss the indexes of profit and capital both
@Anonymous____________A721
@Anonymous____________A721 3 ай бұрын
@@prashantsahu5117 we can take by creating vector of pairs
@kondekarvaishnavi2348
@kondekarvaishnavi2348 3 ай бұрын
since we need at least capital of w to consume a project. Inorder to make sure that we will sort based on capital profit value. If we sort the profit-capital value in descending order but how u will make sure that u will get u have that amount of capital as profit with u? so this is y we sorted capital-profit
@mohit7717
@mohit7717 3 ай бұрын
When I am not able to solve daily leetcode POTD then I prefer your video... I have some doubt can you please answer here.. I have not learn Greedy, heap and priority queue yet .. So its good to solve daily POTD after understanding your solution or what the correct way .. Can u please suggest me?
@harshal8781
@harshal8781 3 ай бұрын
congo for 42k AM ♥
@parasd2802
@parasd2802 3 ай бұрын
thanks for this explanation, also if possible can you please share wtv you write on your screen, would just love to go through it
@agtonybarletta
@agtonybarletta 3 ай бұрын
Thank you for the video, your detailed and slow pace explanation made it much easier to understand 👍
@yummytoeat3433
@yummytoeat3433 3 ай бұрын
Please write a bit bigger. It will help us
@namannema3349
@namannema3349 3 ай бұрын
nice approach
@devahuja9052
@devahuja9052 3 ай бұрын
Hey Aryan ! Hoping you will reply to my query When I first saw this question, I thought of the dp approach and kinda related to the reward part 2 question that recently showed up in the weekly contest 401 and you made a video solving it using bitset, can't this question be solved the same way? Kindly guide Moreover thankyou so much for such amazing content, keep going!
@Vikram_Singh-d9c
@Vikram_Singh-d9c 3 ай бұрын
bro what is DP? and I haven't learned greedy approaches till now how to start?
@funnyanimation888
@funnyanimation888 3 ай бұрын
This was really easy to understand and straight to the point .Thanks a lot.
@_._Harsh_._
@_._Harsh_._ 3 ай бұрын
Excellent Explanation!
@rishiarora8123
@rishiarora8123 3 ай бұрын
nicely explained man!
@mathy642
@mathy642 3 ай бұрын
Excellent approach.
330. Patching Array | Greedy | Array | Math | Why not Bitset Trick
23:19
Как мы играем в игры 😂
00:20
МЯТНАЯ ФАНТА
Рет қаралды 3,3 МЛН
🍉😋 #shorts
00:24
Денис Кукояка
Рет қаралды 3,6 МЛН
Миллионер | 1 - серия
34:31
Million Show
Рет қаралды 2,2 МЛН
🔥Leetcode 502. IPO | Greedy | Sorting | MaxHeap
15:18
Comprehensive Code
Рет қаралды 794
IPO | Leetcode 502 | Heaps
17:50
Ayushi Sharma
Рет қаралды 4,7 М.
The Last Algorithms Course You'll Need by ThePrimeagen | Preview
16:44
Frontend Masters
Рет қаралды 321 М.
IPO - Leetcode 502 - Python
11:57
NeetCodeIO
Рет қаралды 23 М.
2751. Robot Collisions | Stack | Sorting | Not Hard 🫡
19:30
Aryan Mittal
Рет қаралды 6 М.