502. IPO | Greedy | Priority Queue | Sorting
Вставка
- Опубліковано 28 вер 2024
- 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
How to balance College & CP - ua-cam.com/video/79rxV2d86ww/v-deo.html
Amazing explanation...pls explain like this only..❤
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
he always explains clearly,maybe you are 😮💨
@@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??
@@parthtammiwar8609 shut up get lost
Thank you for the video, your detailed and slow pace explanation made it much easier to understand 👍
This was really easy to understand and straight to the point .Thanks a lot.
bro can you please upload gfg potd ,it would be a great help,as your explanation skill are aweasom
Excellent approach.
3:19 if you have already understood the question , the solution begins her
thanks for this explanation, also if possible can you please share wtv you write on your screen, would just love to go through it
What makes this different from the typical knapsack problem so that we don't apply DP?
look at constraints
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?
nice approach
nicely explained man!
Please write a bit bigger. It will help us
Aryan can you why can't we apply DP here?
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
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!
bro what is DP? and I haven't learned greedy approaches till now how to start?
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.
bhai thoda dhire bol dete.... plz
atleast pehle question to dhire dhire batao bhai
This s such a great explanation, starting from why dp and going in the direction of dp and why we cant do dp. Incredible.
42k ❤🔥
Aryan man , This is beautiful explanation.
can we say priority queue will be of size : at max size k ? , just an observation
tq
I was thinking in the direction of profit then but capital is more important their
Sir
Why not sorting with profit-capital value
because we will loss the indexes of profit and capital both
@@prashantsahu5117 we can take by creating vector of pairs
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
congo for 42k AM ♥
Excellent Explanation!