There is a chance of runtime error if length of size array is greater than greed array and all the children got cookies before the loop ends. Ex. g= {1,2}, s= {1,2,3}. We can insert if(r==n) return n; condition after the existing if condition or we can modify the while condition to (l
I was watching one of your sliding window videos, and mom saw you and said ki kitni kamzor h ye ladka , 😅😅😅😂😂😂, then I told my mom about you and your achievements.❤
Striver, your DSA Sheet is absolutely phenomenal! It's been an invaluable resource for mastering data structures and algorithms. Looking forward to the remaining topics, especially the much-anticipated sections on strings and heaps. Thanks for all your hard work!
STARTED A2Z-DSA COURSE : ->STARTED IN JUNE 2023: RECURSION & BACKTRACKING TREES GRAPH DP ARRAYS BINARY SEARCH TILL OCTOBER COMPLETED ALL ABOVE TOPICS ? WAITED ONE MONTH? DECEMBER->LINKEDLIST FEBRUARY->BITMANIPULATION MARCH,APRIL->ADVANCE ARRAY TOPICS MAY->GREEDY STRING & STACK QUEUES ARE DONE BUT STILL WAITING FOR STRIVER TO LAUNCH IT AS WELL: WAITING FOR SYSTEM DESIGN & COMPETITIVE PROGRAMMING VIDEOS AS WELL THAT IS TAUGHT BY YOU THANK YOU SO MUCH FOR THIS AMAZING CONTENT (striver)?
thank u striver i've asked you many times.but finally the playlist is here.and also post stack and queue playlistand then please make more than 60 videos on greedy.Even my aim to hit the google.I hope you will help me out to crack it.
Thankyou so much Striver for all you efforts throughout in delivering us so much valuable content. Any student / working professional can now be able to transition their career without paying money for courses. Would also like your insights on the point : While preparing for interviews most of the aspirants are going through the videos solely and solving the question after completely watching the video. And also are feeling lazy trying to solve the question on our own. What is the best way to complete any topic without being lazy and how should an aspirant approach any topic/playlist?
Alternate recursive solution in C++ class Solution { public: int findContentChildren(vector& g, vector& s) { sort(g.begin(), g.end()); sort(s.begin(), s.end()); return maxContentChildren(g, s, 0, 0); } private: int maxContentChildren(const vector& g, const vector& s, int i, int j) { if (i == g.size() || j == s.size()) { return i; } if (s[j] >= g[i]) { // Either we give the current cookie to the current child return maxContentChildren(g, s, i + 1, j + 1); } else { // Or we skip the current cookie return maxContentChildren(g, s, i, j + 1); } } };
C++ solution of above video class Solution { public: int findContentChildren(vector& g, vector& s) { sort(g.begin(), g.end()); sort(s.begin(),s.end()); int left=0; int right=0; while(left
class Solution { public: int findContentChildren(vector& g, vector& s) { int m = g.size(); int n = s.size(); int l = 0, r = 0; sort(g.begin(), g.end()); sort(s.begin(), s.end()); while (r < m && l
cpp solution #include #include #include using namespace std; class Solution { public: int findContentChildren(vector& g, vector& s) { sort(g.begin(), g.end()); sort(s.begin(), s.end()); int ans = 0, i = 0, j = 0; int n = g.size(), m = s.size(); while (i < n && j < m) { if (s[j] >= g[i]) { ans++; i++; j++; } else { j++; } } return ans; } };
Guys. He'll release strings eventually don't worry. Let him chill. He's done more than enough for us already. Thank u so so much bro
Yeah We want it bro
Strings playlist please striver
Yup ++
Next wahii h
@@AkshitChaudhary-vx8iw aapko kaise pta bhai really. Shall I wait for it??
@@RajNamdev_19 striver ne tweet Kiya tha👍
@@AkshitChaudhary-vx8iw next stack and queue uske bad heap uske bad recursion aur last me string
There is a chance of runtime error if length of size array is greater than greed array and all the children got cookies before the loop ends. Ex. g= {1,2}, s= {1,2,3}. We can insert if(r==n) return n; condition after the existing if condition or we can modify the while condition to (l
I was watching one of your sliding window videos, and mom saw you and said ki kitni kamzor h ye ladka , 😅😅😅😂😂😂, then I told my mom about you and your achievements.❤
mom momy
My mom is like, why do you watch him so much? What is he even teaching you? Can you please go to sleep 🙁😂😂😂
@@mehekmale5045 fr lol
Striver, your DSA Sheet is absolutely phenomenal! It's been an invaluable resource for mastering data structures and algorithms. Looking forward to the remaining topics, especially the much-anticipated sections on strings and heaps.
Thanks for all your hard work!
bro why it's showing unauthorised after i sign in On takeuforward page
May be server issue
Thank you so much striver for these priceless premium lectures.
Please release the strings series before the placement season begins.
correction in while add one codition for r
Thank you sooo much @striver. Wanted this since long.....
Thank you so much! Was looking forward to greedy series
STARTED A2Z-DSA COURSE :
->STARTED IN JUNE 2023:
RECURSION & BACKTRACKING
TREES
GRAPH
DP
ARRAYS
BINARY SEARCH
TILL OCTOBER COMPLETED ALL ABOVE TOPICS ?
WAITED ONE MONTH?
DECEMBER->LINKEDLIST
FEBRUARY->BITMANIPULATION
MARCH,APRIL->ADVANCE ARRAY TOPICS
MAY->GREEDY
STRING & STACK QUEUES ARE DONE BUT STILL WAITING FOR STRIVER TO LAUNCH IT AS WELL:
WAITING FOR SYSTEM DESIGN & COMPETITIVE PROGRAMMING VIDEOS AS WELL THAT IS TAUGHT BY YOU
THANK YOU SO MUCH FOR THIS AMAZING CONTENT (striver)?
Most awaited playlist for me :)
Yes sir, because of you we are doing extremely well 😊
Thank you so much ❤
strings playlist is the ultimate thing needed.
thank u striver i've asked you many times.but finally the playlist is here.and also post stack and queue playlistand then please make more than 60 videos on greedy.Even my aim to hit the google.I hope you will help me out to crack it.
Babe wake up! Another striver playlist dropped 🗣️🗣️
You are awesome bro thank you so much ❤
Thankyou so much Striver for all you efforts throughout in delivering us so much valuable content. Any student / working professional can now be able to transition their career without paying money for courses.
Would also like your insights on the point :
While preparing for interviews most of the aspirants are going through the videos solely and solving the question after completely watching the video. And also are feeling lazy trying to solve the question on our own. What is the best way to complete any topic without being lazy and how should an aspirant approach any topic/playlist?
Bro is back 🤩🤩🥳
We need to add the condition (r
yes we should
Update these links in the the sheet as well striver. This is great
yo yo my man is back
vhaiya tusi great ho.. thanks alot ..🥰
just a small correction in the while loop condition
while(l
Lec 1 Done and Understood.
Strings playlist 💫
Alternate recursive solution in C++
class Solution {
public:
int findContentChildren(vector& g, vector& s) {
sort(g.begin(), g.end());
sort(s.begin(), s.end());
return maxContentChildren(g, s, 0, 0);
}
private:
int maxContentChildren(const vector& g, const vector& s, int i, int j) {
if (i == g.size() || j == s.size()) {
return i;
}
if (s[j] >= g[i]) {
// Either we give the current cookie to the current child
return maxContentChildren(g, s, i + 1, j + 1);
} else {
// Or we skip the current cookie
return maxContentChildren(g, s, i, j + 1);
}
}
};
🎉Thanks bro
Best content ❤
thanks sir the video was very helpful
Bhai takeuforward ke greedy playlist ko please update kar do as along u make video .
Great content ❤
String playlist please
Put string playlist also
You satisfied us
Thanks sir
thanks
the first problem i solved before waching his vedio 😊
ty sir
understood
#striver heaps playlist is needed using Max heap within this week. Please....
C++ solution of above video
class Solution {
public:
int findContentChildren(vector& g, vector& s) {
sort(g.begin(), g.end());
sort(s.begin(),s.end());
int left=0;
int right=0;
while(left
why is video in the dynamic programming section on TUF
started today this playlist ......05/06/2024.....i will comment this comment when i complete this greedy algorithm series
class Solution {
public:
int findContentChildren(vector& g, vector& s) {
int m = g.size();
int n = s.size();
int l = 0, r = 0;
sort(g.begin(), g.end());
sort(s.begin(), s.end());
while (r < m && l
Thanks
Greedy playlist making everyone Greedy for Strings
please add link to this video in your a2z sheet, it is not there. only says coming soon
Make playlist on heap
bhaiya please string ki nikal dijiye bhaut problem hoti solve karne me string me logic bhi nhi bnte please bhaiya
Please string
I easily think about that problem may be due to doing cp.
Heap playlist please
❤
Striver Is GOD... ❤
expected 😀😀
19th of June 2024 I started Today
cpp solution
#include
#include
#include
using namespace std;
class Solution {
public:
int findContentChildren(vector& g, vector& s) {
sort(g.begin(), g.end());
sort(s.begin(), s.end());
int ans = 0, i = 0, j = 0;
int n = g.size(), m = s.size();
while (i < n && j < m) {
if (s[j] >= g[i]) {
ans++;
i++;
j++;
} else {
j++;
}
}
return ans;
}
};
int findContentChildren(vector& g, vector& s) {
int n=g.size(),m=s.size();
sort(g.begin(),g.end());
sort(s.begin(),s.end());
int r=0;
int l = 0;
while (r < n && l < m) {
if (g[r]
US
please bring the string video first .A humble request from us
Hii
Doing like the video is important, my one like make 1K, your one like can make 100k;👍🏼👍🏼
First
1 st view
can you change your outro song, its very cringe
stack and queue.........
btw thanks striver....................................................
Striver = Red Always