L1. Assign Cookies | Greedy Algorithm Playlist

Поделиться
HTML-код
  • Опубликовано: 20 май 2024
  • Find problem link, notes under Step 12: takeuforward.org/strivers-a2z...
    Follow me on socials: linktr.ee/takeUforward

Комментарии • 84

  • @xenostar3606
    @xenostar3606 Месяц назад +62

    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

  • @bhuvaneswarjakka
    @bhuvaneswarjakka Месяц назад +135

    Strings playlist please striver

    • @badcode8139
      @badcode8139 Месяц назад +2

      Yup ++

    • @AkshitChaudhary-vx8iw
      @AkshitChaudhary-vx8iw Месяц назад +3

      Next wahii h

    • @RajNamdev_19
      @RajNamdev_19 Месяц назад +1

      @@AkshitChaudhary-vx8iw aapko kaise pta bhai really. Shall I wait for it??

    • @AkshitChaudhary-vx8iw
      @AkshitChaudhary-vx8iw Месяц назад +1

      @@RajNamdev_19 striver ne tweet Kiya tha👍

    • @KartikeyTT
      @KartikeyTT 20 дней назад +3

      @@AkshitChaudhary-vx8iw next stack and queue uske bad heap uske bad recursion aur last me string

  • @raviteja_v7
    @raviteja_v7 Месяц назад +24

    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

  • @akshatchaturvedi7407
    @akshatchaturvedi7407 Месяц назад +36

    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 Месяц назад

      mom momy

    • @mehekmale5045
      @mehekmale5045 Месяц назад +1

      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 27 дней назад

      @@mehekmale5045 fr lol

  • @ritikkumarsingh5902
    @ritikkumarsingh5902 Месяц назад +10

    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 Месяц назад

      bro why it's showing unauthorised after i sign in On takeuforward page

    • @ritikkumarsingh5902
      @ritikkumarsingh5902 Месяц назад

      May be server issue

  • @shibainu7500
    @shibainu7500 Месяц назад +3

    Thank you so much striver for these priceless premium lectures.
    Please release the strings series before the placement season begins.

  • @sujeetpawar5162
    @sujeetpawar5162 Месяц назад +2

    correction in while add one codition for r

  • @srishtipandey6068
    @srishtipandey6068 Месяц назад

    Thank you sooo much @striver. Wanted this since long.....

  • @shreerangaraju1013
    @shreerangaraju1013 Месяц назад

    Thank you so much! Was looking forward to greedy series

  • @ThakurCricket18
    @ThakurCricket18 Месяц назад +7

    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)?

  • @atulwadhwa192
    @atulwadhwa192 Месяц назад +1

    Most awaited playlist for me :)

  • @jasvanth_AA
    @jasvanth_AA Месяц назад +1

    Yes sir, because of you we are doing extremely well 😊
    Thank you so much ❤

  • @HarshKrSingh
    @HarshKrSingh Месяц назад

    strings playlist is the ultimate thing needed.

  • @user-vu4ng4rb8k
    @user-vu4ng4rb8k Месяц назад +1

    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 Месяц назад +1

    Babe wake up! Another striver playlist dropped 🗣️🗣️

  • @jeelsojeetra6468
    @jeelsojeetra6468 Месяц назад

    You are awesome bro thank you so much ❤

  • @Cool96267
    @Cool96267 Месяц назад

    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?

  • @pranithreddy
    @pranithreddy Месяц назад +1

    Bro is back 🤩🤩🥳

  • @mohammadaseem7823
    @mohammadaseem7823 Месяц назад +1

    We need to add the condition (r

  • @niii5715
    @niii5715 24 дня назад

    Update these links in the the sheet as well striver. This is great

  • @parvahuja7618
    @parvahuja7618 Месяц назад

    yo yo my man is back

  • @59_sujatachandra76
    @59_sujatachandra76 Месяц назад

    vhaiya tusi great ho.. thanks alot ..🥰

  • @Shishir.435
    @Shishir.435 Месяц назад +2

    just a small correction in the while loop condition
    while(l

  • @mukeshrawat8816
    @mukeshrawat8816 Месяц назад +1

    Lec 1 Done and Understood.

  • @riteshbisht94
    @riteshbisht94 Месяц назад +3

    Strings playlist 💫

  • @KartikeyTT
    @KartikeyTT 20 дней назад +1

    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);
    }
    }
    };

  • @mosalah151
    @mosalah151 Месяц назад

    🎉Thanks bro

  • @aashishsingune5138
    @aashishsingune5138 Месяц назад

    Best content ❤

  • @kathakalisaha9735
    @kathakalisaha9735 День назад

    thanks sir the video was very helpful

  • @badcode8139
    @badcode8139 Месяц назад

    Bhai takeuforward ke greedy playlist ko please update kar do as along u make video .
    Great content ❤

  • @peakyblinderzz
    @peakyblinderzz Месяц назад +4

    String playlist please

  • @ParkersFact_Finder
    @ParkersFact_Finder Месяц назад +6

    Put string playlist also

  • @solvinglife6658
    @solvinglife6658 22 дня назад

    You satisfied us

  • @sanchitdeepsingh9663
    @sanchitdeepsingh9663 Месяц назад

    Thanks sir

  • @subee128
    @subee128 Месяц назад

    thanks

  • @shreedevimg
    @shreedevimg 5 дней назад

    the first problem i solved before waching his vedio 😊

  • @KartikeyTT
    @KartikeyTT Месяц назад +1

    ty sir

  • @harshitjaiswal9439
    @harshitjaiswal9439 Месяц назад

    understood

  • @srishtipandey6068
    @srishtipandey6068 Месяц назад

    #striver heaps playlist is needed using Max heap within this week. Please....

  • @KartikeyTT
    @KartikeyTT 20 дней назад +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

  • @abhishekkumar-fe8lw
    @abhishekkumar-fe8lw 5 дней назад

    why is video in the dynamic programming section on TUF

  • @raghavmanish24
    @raghavmanish24 Месяц назад +1

    started today this playlist ......05/06/2024.....i will comment this comment when i complete this greedy algorithm series

  • @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

  • @clintonpinto2925
    @clintonpinto2925 Месяц назад

    Greedy playlist making everyone Greedy for Strings

  • @teeyaojha4365
    @teeyaojha4365 Месяц назад

    please add link to this video in your a2z sheet, it is not there. only says coming soon

  • @SagarSharma-ys4lu
    @SagarSharma-ys4lu Месяц назад

    Make playlist on heap

  • @aviralsingh2163
    @aviralsingh2163 Месяц назад +1

    bhaiya please string ki nikal dijiye bhaut problem hoti solve karne me string me logic bhi nhi bnte please bhaiya

  • @samitkumar18
    @samitkumar18 Месяц назад +2

    Please string

  • @Adarsh_agrahari
    @Adarsh_agrahari Месяц назад

    I easily think about that problem may be due to doing cp.

  • @AvinashJha-zi5cz
    @AvinashJha-zi5cz Месяц назад

    Heap playlist please

  • @subornonaskar1932
    @subornonaskar1932 Месяц назад

  • @kmskfsdkmfmsdkmf
    @kmskfsdkmfmsdkmf Месяц назад

    Striver Is GOD... ❤

  • @angeldeveloper
    @angeldeveloper Месяц назад

    expected 😀😀

  • @anushthasinghkushwah954
    @anushthasinghkushwah954 28 дней назад

    19th of June 2024 I started Today

  • @aggarwalsachin4854
    @aggarwalsachin4854 Месяц назад

    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;
    }
    };

  • @Manikaushaki
    @Manikaushaki Месяц назад

    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]

  • @surbhigupta5777
    @surbhigupta5777 Месяц назад

    US

  • @prerakunhale50
    @prerakunhale50 Месяц назад

    please bring the string video first .A humble request from us

  • @gauravmaddi3381
    @gauravmaddi3381 Месяц назад

    Hii

  • @purushottam108
    @purushottam108 17 дней назад

    Doing like the video is important, my one like make 1K, your one like can make 100k;👍🏼👍🏼

  • @pronoynath1171
    @pronoynath1171 Месяц назад +1

    First

  • @yashwantj8572
    @yashwantj8572 Месяц назад

    1 st view

  • @LuckyKumar-mt9km
    @LuckyKumar-mt9km Месяц назад +1

    can you change your outro song, its very cringe

  • @parth_3856
    @parth_3856 Месяц назад +3

    stack and queue.........
    btw thanks striver....................................................

  • @CodeNinja18
    @CodeNinja18 Месяц назад +1

    Striver = Red Always