L1. Assign Cookies | Greedy Algorithm Playlist

  Рет қаралды 123,215

take U forward

take U forward

Күн бұрын

Пікірлер: 119
@xenostar3606
@xenostar3606 6 ай бұрын
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
@RajNamdev_19
@RajNamdev_19 5 ай бұрын
Yeah We want it bro
@raviteja_v7
@raviteja_v7 6 ай бұрын
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
@manavpatnaik222
@manavpatnaik222 2 ай бұрын
Exactly. Thanks for pointing it out.
@IITian-NITian_0305
@IITian-NITian_0305 2 ай бұрын
brother by doing simple change in the while code we can remove it indexoutofbound exception like: while(l
@sujeetpawar5162
@sujeetpawar5162 6 ай бұрын
correction in while add one codition for r
@ritikkumarsingh5902
@ritikkumarsingh5902 6 ай бұрын
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!
@sano9633
@sano9633 6 ай бұрын
bro why it's showing unauthorised after i sign in On takeuforward page
@ritikkumarsingh5902
@ritikkumarsingh5902 5 ай бұрын
May be server issue
@bhuvaneswarjakka
@bhuvaneswarjakka 6 ай бұрын
Strings playlist please striver
@badcode8139
@badcode8139 6 ай бұрын
Yup ++
@AkshitChaudhary-vx8iw
@AkshitChaudhary-vx8iw 6 ай бұрын
Next wahii h
@RajNamdev_19
@RajNamdev_19 5 ай бұрын
@@AkshitChaudhary-vx8iw aapko kaise pta bhai really. Shall I wait for it??
@AkshitChaudhary-vx8iw
@AkshitChaudhary-vx8iw 5 ай бұрын
@@RajNamdev_19 striver ne tweet Kiya tha👍
@KartikeyTT
@KartikeyTT 5 ай бұрын
@@AkshitChaudhary-vx8iw next stack and queue uske bad heap uske bad recursion aur last me string
@shibainu7500
@shibainu7500 6 ай бұрын
Thank you so much striver for these priceless premium lectures. Please release the strings series before the placement season begins.
@tharabhaigamer82
@tharabhaigamer82 4 ай бұрын
The best thing about striver that no one talks about is that there are no adds on his channel in between .
@akshatchaturvedi7407
@akshatchaturvedi7407 6 ай бұрын
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.❤
@emc2xenon46
@emc2xenon46 6 ай бұрын
mom momy
@mehekswe
@mehekswe 5 ай бұрын
My mom is like, why do you watch him so much? What is he even teaching you? Can you please go to sleep 🙁😂😂😂
@moonlight-td8ed
@moonlight-td8ed 5 ай бұрын
@@mehekswe fr lol
@Jyotigupta-vs4mz
@Jyotigupta-vs4mz 3 ай бұрын
mom is mom😁,my mom is planning to marry with him 😆striver if you reading , i 'd love to accept the offer🤪💌
@Reyna-yj6vo
@Reyna-yj6vo 3 ай бұрын
@@Jyotigupta-vs4mz im better than striver
@mohammadaseem7823
@mohammadaseem7823 5 ай бұрын
We need to add the condition (r
@GungunSaluja-sy6br
@GungunSaluja-sy6br 5 ай бұрын
yes we should
@ThakurCricket18
@ThakurCricket18 6 ай бұрын
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)?
@jasvanth_AA
@jasvanth_AA 6 ай бұрын
Yes sir, because of you we are doing extremely well 😊 Thank you so much ❤
@SowjanyaG-yk3cc
@SowjanyaG-yk3cc 4 ай бұрын
in the if statement , && r
@349_rahulbhattacharya6
@349_rahulbhattacharya6 2 ай бұрын
bhiaya the code in the article is not correct ...it should have been this while (l < m && r < n) { // If the current cookie can // satisfy the current child's greed if (greed[r]
@HarshKrSingh
@HarshKrSingh 5 ай бұрын
strings playlist is the ultimate thing needed.
@srishtipandey6068
@srishtipandey6068 6 ай бұрын
Thank you sooo much @striver. Wanted this since long.....
@Logeshwar-s7m
@Logeshwar-s7m 6 ай бұрын
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.
@_anteikuu_2400
@_anteikuu_2400 6 ай бұрын
Babe wake up! Another striver playlist dropped 🗣️🗣️
@ParkersFact_Finder
@ParkersFact_Finder 6 ай бұрын
Put string playlist also
@shreerangaraju1013
@shreerangaraju1013 6 ай бұрын
Thank you so much! Was looking forward to greedy series
@peakyblinderzz
@peakyblinderzz 6 ай бұрын
String playlist please
@yashhokte1020
@yashhokte1020 15 күн бұрын
So i just came here understand the question and able to do it myself: Here is the code : class Solution { public int findContentChildren(int[] g, int[] s) { Arrays.sort(g); Arrays.sort(s); int i = 0, j = 0, size1 = g.length, size2 = s.length, res = 0; while (i < size1 && j < size2) { if (g[i]
@akshadpaithankar6740
@akshadpaithankar6740 2 ай бұрын
I think there's a mistake in the A2Z DSA sheet. This question has been added to the "DP on Subsequences" portion, that too in HARD category lol...
@Cool96267
@Cool96267 6 ай бұрын
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?
@atulwadhwa192
@atulwadhwa192 6 ай бұрын
Most awaited playlist for me :)
@Shishir.435
@Shishir.435 6 ай бұрын
just a small correction in the while loop condition while(l
@riteshbisht94
@riteshbisht94 6 ай бұрын
Strings playlist 💫
@KartikeyTT
@KartikeyTT 5 ай бұрын
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); } } };
@shreedevimg
@shreedevimg 4 ай бұрын
the first problem i solved before waching his vedio 😊
@Anandumbb
@Anandumbb 5 ай бұрын
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
@Lakshya-f4l
@Lakshya-f4l 5 ай бұрын
Thanks
@badcode8139
@badcode8139 6 ай бұрын
Bhai takeuforward ke greedy playlist ko please update kar do as along u make video . Great content ❤
@shauryatomer1058
@shauryatomer1058 Күн бұрын
Thanks for another great video
@niii5715
@niii5715 5 ай бұрын
Update these links in the the sheet as well striver. This is great
@RohitKumar-nx8pd
@RohitKumar-nx8pd 2 ай бұрын
class Solution { public: int findContentChildren(vector& g, vector& s) { cin.tie(nullptr) -> sync_with_stdio(false); sort(g.begin(),g.end()); sort(s.begin(),s.end()); int count = 0; int p = 0; //g --> children int q = 0; //s --> cookie while(p
@mukeshrawat8816
@mukeshrawat8816 6 ай бұрын
Lec 1 Done and Understood.
@MJBZG
@MJBZG 3 ай бұрын
solved it before watching
@abhishekkumar-fe8lw
@abhishekkumar-fe8lw 4 ай бұрын
why is video in the dynamic programming section on TUF
@Rohith__Dev
@Rohith__Dev 3 ай бұрын
Is there any prerequesties to start this Greedy Algo's Playlist ?? help me out !!
@UECAshutoshKumar
@UECAshutoshKumar 2 ай бұрын
Thank you 🙏
@59_sujatachandra76
@59_sujatachandra76 6 ай бұрын
vhaiya tusi great ho.. thanks alot ..🥰
@pranithreddy
@pranithreddy 6 ай бұрын
Bro is back 🤩🤩🥳
@raghavmanish24
@raghavmanish24 5 ай бұрын
started today this playlist ......05/06/2024.....i will comment this comment when i complete this greedy algorithm series
@srishtipandey6068
@srishtipandey6068 5 ай бұрын
#striver heaps playlist is needed using Max heap within this week. Please....
@aviralsingh2163
@aviralsingh2163 6 ай бұрын
bhaiya please string ki nikal dijiye bhaut problem hoti solve karne me string me logic bhi nhi bnte please bhaiya
@kathakalisaha9735
@kathakalisaha9735 4 ай бұрын
thanks sir the video was very helpful
@kaichang8186
@kaichang8186 Ай бұрын
understood, thanks for the video
@jeelsojeetra6468
@jeelsojeetra6468 6 ай бұрын
You are awesome bro thank you so much ❤
@Adarsh_agrahari
@Adarsh_agrahari 6 ай бұрын
I easily think about that problem may be due to doing cp.
@user-rdr1712
@user-rdr1712 3 ай бұрын
var findContentChildren = function (g, s) { s.sort((a, b) => a - b); g.sort((a, b) => a - b); let i = g.length - 1, j = s.length - 1, count = 0; while (i >= 0 && j >= 0) { if (s[j] >= g[i]) { j--; count++; } i--; } return count; };
@samitkumar18
@samitkumar18 6 ай бұрын
Please string
@saimyousuf2108
@saimyousuf2108 3 ай бұрын
Strings please
@ITSuyashTiwari
@ITSuyashTiwari 4 ай бұрын
we want heap playlist...😊
@Enigm.1.
@Enigm.1. 2 ай бұрын
y us this showing in a-z dp playlist????
@AvinashJha-zi5cz
@AvinashJha-zi5cz 5 ай бұрын
Heap playlist please
@KartikeyTT
@KartikeyTT 5 ай бұрын
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
@teeyaojha4365
@teeyaojha4365 5 ай бұрын
please add link to this video in your a2z sheet, it is not there. only says coming soon
@vishalsagar1437
@vishalsagar1437 4 ай бұрын
it should be l < m && r < n
@MohitKumar-o3l1u
@MohitKumar-o3l1u 3 ай бұрын
Understood !!
@SagarSharma-ys4lu
@SagarSharma-ys4lu 6 ай бұрын
Make playlist on heap
@prerakunhale50
@prerakunhale50 6 ай бұрын
please bring the string video first .A humble request from us
@mosalah151
@mosalah151 6 ай бұрын
🎉Thanks bro
@aashishsingune5138
@aashishsingune5138 6 ай бұрын
Best content ❤
@aggarwalsachin4854
@aggarwalsachin4854 5 ай бұрын
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; } };
@solvinglife6658
@solvinglife6658 5 ай бұрын
You satisfied us
@parvahuja7618
@parvahuja7618 5 ай бұрын
yo yo my man is back
@clintonpinto2925
@clintonpinto2925 5 ай бұрын
Greedy playlist making everyone Greedy for Strings
@parth_3856
@parth_3856 6 ай бұрын
stack and queue......... btw thanks striver....................................................
@Manikaushaki
@Manikaushaki 5 ай бұрын
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]
@mohammadumaidansari5087
@mohammadumaidansari5087 4 ай бұрын
Understood
@sanchitdeepsingh9663
@sanchitdeepsingh9663 5 ай бұрын
Thanks sir
@KartikeyTT
@KartikeyTT 5 ай бұрын
ty sir
@studystuff51
@studystuff51 3 ай бұрын
Is there a heaps playlist I am missing?
@anushthasinghkushwah954
@anushthasinghkushwah954 5 ай бұрын
19th of June 2024 I started Today
@subee128
@subee128 5 ай бұрын
thanks
@StudyYuv
@StudyYuv 4 ай бұрын
ty
@harshitjaiswal9439
@harshitjaiswal9439 5 ай бұрын
understood
@rahulhembram4519
@rahulhembram4519 3 ай бұрын
UnderStood
@purushottam108
@purushottam108 4 ай бұрын
Doing like the video is important, my one like make 1K, your one like can make 100k;👍🏼👍🏼
@subornonaskar1932
@subornonaskar1932 6 ай бұрын
@angeldeveloper
@angeldeveloper 6 ай бұрын
expected 😀😀
@aryankumar3018
@aryankumar3018 3 ай бұрын
UNderstood
@surbhigupta5777
@surbhigupta5777 5 ай бұрын
US
@gauravmaddi3381
@gauravmaddi3381 6 ай бұрын
Hii
@pronoynath1171
@pronoynath1171 6 ай бұрын
First
@yashwantj8572
@yashwantj8572 6 ай бұрын
1 st view
@LuckyKumar-mt9km
@LuckyKumar-mt9km 5 ай бұрын
can you change your outro song, its very cringe
@CodeNinja18
@CodeNinja18 6 ай бұрын
Striver = Red Always
@SYCOA12CHAITANYAASOLE
@SYCOA12CHAITANYAASOLE 3 ай бұрын
Understood !!
@hasnainy0
@hasnainy0 Ай бұрын
Thanks
@adityapandey23
@adityapandey23 3 ай бұрын
Understood
@pratyushgangwar9747
@pratyushgangwar9747 Ай бұрын
understood
@CSEA_58ShayoriBhowmick
@CSEA_58ShayoriBhowmick 3 ай бұрын
Understood
@mohammadafif2549
@mohammadafif2549 20 күн бұрын
understood
@SibiRanganathL
@SibiRanganathL 2 ай бұрын
Understood
@NipunGupta-i3h
@NipunGupta-i3h Ай бұрын
Understood
L2. Lemonade Change | Greedy Algorithm Playlist
9:00
take U forward
Рет қаралды 43 М.
The Singing Challenge #joker #Harriet Quinn
00:35
佐助与鸣人
Рет қаралды 44 МЛН
СКОЛЬКО ПАЛЬЦЕВ ТУТ?
00:16
Masomka
Рет қаралды 3,3 МЛН
I Solved 1583 Leetcode Questions  Here's What I Learned
20:37
ThePrimeTime
Рет қаралды 736 М.
Coding Unbreakable Encryption in C | One-Time Pad
17:42
HirschDaniel
Рет қаралды 4,4 М.
L5. Jump Game - II | Greedy Algorithm Playlist
16:45
take U forward
Рет қаралды 67 М.
L4. Jump Game - I | Greedy Algorithm Playlist
10:53
take U forward
Рет қаралды 60 М.
L11. Valid Parenthesis String | Multiple Approaches
26:09
take U forward
Рет қаралды 46 М.
How I would learn Leetcode if I could start over
18:03
NeetCodeIO
Рет қаралды 688 М.
L6. Job Sequencing Problem | Greedy Algorithm Playlist
16:07
take U forward
Рет қаралды 51 М.
The Singing Challenge #joker #Harriet Quinn
00:35
佐助与鸣人
Рет қаралды 44 МЛН