7. Subsequences, Power Set using Recursion Code - Practise with me, understand code in detail! 🚀🔥

Sdílet
Vložit
  • čas přidán 23. 07. 2022
  • You can practise the question here-
    bit.ly/3cqq0Dy
    𝐃𝐨𝐧'𝐭 𝐜𝐥𝐢𝐜𝐤 𝐡𝐞𝐫𝐞- bit.ly/3PCiXWD
    Subscribe and hit the notification icon to get notifications and learn with me everyday!! ❤️❤️
    #dsa #softwaredeveloper #interviewpreparation

Komentáře • 57

  • @codefromscratch-keertipurswani

    How does it feel to solve medium level recursion questions? ❤️

    • @cricketguru7596
      @cricketguru7596 Před 2 lety +2

      Visualization of recursive tree was little difficult? Having a high hope, after going through this series i will be more comfortable

    • @codefromscratch-keertipurswani
      @codefromscratch-keertipurswani  Před 2 lety +3

      @@cricketguru7596 let me know if you have any doubts. M here. You just watch the videos properly!

    • @cricketguru7596
      @cricketguru7596 Před 2 lety +1

      @@codefromscratch-keertipurswani yes sure

    • @Nishchay-kc1gb
      @Nishchay-kc1gb Před 2 lety

      Now i am understanding more clearly and speed has increased a bit

    • @yuv09
      @yuv09 Před 2 lety

      The question is rated easy, but it seems like hard one 😅😅😅

  • @saurabhbera4833
    @saurabhbera4833 Před 2 lety +5

    I used to get scared using recursion. But these days I think recursion is fun it's all about recursive faith😂❤️

  • @unknowncoder409
    @unknowncoder409 Před rokem +1

    Yes the second catch was that we had to remove the empty string from the resultant vector as it is asked in the problem statement. Thank you Mam for great teaching!!!

  • @sameer9368
    @sameer9368 Před 2 lety +1

    Since I am your senior experience wise... I always follow your video the way you provide detail explanation...please keep motivating us

  • @prakashbtw678
    @prakashbtw678 Před 2 lety +1

    I have been waiting for this. Thank you thank you

  • @swathijaishetty460
    @swathijaishetty460 Před 2 lety +1

    Thanks for putting so much of efforts, to make us understand clearly :)

  • @rajinderkaur7658
    @rajinderkaur7658 Před 2 lety +1

    Great explanation mam👌gaining confidence day by day only because of you💪thankyou❤more power to you❤❤❤

  • @Hustle_bussle
    @Hustle_bussle Před 2 lety +2

    I hope I can explain every DSA concept as easily as you do!!Looking forward to that day✌🤞

  • @MdRizwan-uu9dv
    @MdRizwan-uu9dv Před 2 lety +1

    Thankyou didi for this wonderful explanation👌👍👌👍👌

  • @MaheshBabuGurram
    @MaheshBabuGurram Před 2 lety

    Hi Keerthi,
    These videos are really helpful. I have shared it with my friend and they subscribed to the channel. One suggestion, could you discuss time and space complexity for each of the problems that you are covering?

  • @bharanisrianbalagan1924
    @bharanisrianbalagan1924 Před 2 lety +1

    such a nice explanation ever

  • @arjunyadav-kt5jr
    @arjunyadav-kt5jr Před rokem

    i could figure out the second catch easily, because keerti does not let us forget anything!!

  • @nidhikumari1479
    @nidhikumari1479 Před 2 lety +1

    Thank you so much mam! Solving a medium level rec. ques. feels great.👍

  • @ShubhamSingh-gk8vp
    @ShubhamSingh-gk8vp Před 2 lety

    let goooo !!

  • @jagdishkumawat2738
    @jagdishkumawat2738 Před 2 lety +1

    💯🔥

  • @nidhibansaliitr
    @nidhibansaliitr Před 2 lety +1

    I wrote it like a mix of iterative + recursive manner.
    Please share your view point on the code.
    void helper(List list, String s, String sChar, int total, int counter){
    char [] charArray = s.toCharArray();
    if(!list.isEmpty()){
    int size = list.size();
    for(int i =0; i

  • @rtarts1524
    @rtarts1524 Před 2 lety

    Thank You Mam..

  • @prashanthiaruna8501
    @prashanthiaruna8501 Před 2 lety

    Am still in binary search only i practice in weekends as I don have time is this normal to be this slow ??

  • @nithishnair6265
    @nithishnair6265 Před 2 lety

    Present 👍

  • @cricketguru7596
    @cricketguru7596 Před 2 lety

    Present 🔥

  • @ashwinisunilchoudhari9660

    I have one doubt mam , after include helper get executed one time ,the next exclude helper should get executed.?
    but in explanation according to my understanding after first helper reached to n , base condition is executing and then exclude helper.

  • @GauravKumar-by1yt
    @GauravKumar-by1yt Před 2 lety

    Thank you

  • @jasmindersingh6708
    @jasmindersingh6708 Před 2 lety +1

    We found 8 number of subsequences but they ask for only 7 subsequences. The extra one is empty (" ").

  • @paraschauhan4466
    @paraschauhan4466 Před 2 lety

    I also write dii current . length is greater than zero than res.pushbackcurrent

  • @surojitsantra7627
    @surojitsantra7627 Před 2 lety

    🙋

  • @hackerIfeelYou
    @hackerIfeelYou Před 2 lety

    Present ma'am 🤞

  • @ashwaniarchivee
    @ashwaniarchivee Před 2 lety

    Present ma'am.

  • @mohdhaseeb9818
    @mohdhaseeb9818 Před 2 lety

    Present Ma'am

  • @VishalYadav-vt4cw
    @VishalYadav-vt4cw Před 2 lety

    🙋‍♂️

  • @JardaniJovonovich192
    @JardaniJovonovich192 Před 2 lety

    Thanks for the video. In GFG, it is mentioned that the expected space complexity is O(n*2^n). Shouldn't the SC be just O(2^n) ?

    • @codefromscratch-keertipurswani
      @codefromscratch-keertipurswani  Před 2 lety +2

      Will cover this in a youtube short tomorrow. Should have talked about it. Thanks for pointing it out ❤️

    • @div0007
      @div0007 Před rokem

      Think of SC as an array of array, where total elems in the outer array are 2^N and each element(which is also an array of char aka string) can have max length of N. so SC will be size each elem * number of elems or O(N*2^N)

  • @vigneshiyer1765
    @vigneshiyer1765 Před 2 lety

    Present mam!!

  • @myth__un
    @myth__un Před 2 lety

    Present ma'am

  • @deepchill5295
    @deepchill5295 Před 2 lety

    Day 19- present 🙋‍♂️

  • @nidhibansaliitr
    @nidhibansaliitr Před 2 lety

    I was able to write code by myself. But your code is always more crisp.

  • @Nishchay-kc1gb
    @Nishchay-kc1gb Před 2 lety

    I am solving

  • @varunendra.singh_
    @varunendra.singh_ Před 2 lety

    Day 19🙋

  • @learner7940
    @learner7940 Před rokem

    Did anyone do this in JS ?

  • @simran1277
    @simran1277 Před rokem

    SUMMARY
    =============================
    Write code for including character and excluding character
    Push "curr_subsequence" to "ans" when curr_idx == n
    Another way to remove the empty string from "ans" is to pop_back before sorting
    REASON: empty string will always be added to "ans" at last only
    Alternative code
    class Solution{
    public:
    void helper(string s, int curr_idx, int n, string curr_subsequence, vector &ans){
    if(curr_idx == n){
    ans.push_back(curr_subsequence);
    return;
    }
    // include character
    helper(s,curr_idx+1,n,curr_subsequence+s[curr_idx],ans);
    // not include character
    helper(s,curr_idx+1,n,curr_subsequence,ans);
    }
    vector AllPossibleStrings(string s){
    vector ans;
    helper(s,0,s.length(),"",ans);
    ans.pop_back(); // remove empty string
    sort(ans.begin(),ans.end());
    return ans;
    }
    };

  • @arunkumarmohandas4420
    @arunkumarmohandas4420 Před 2 lety

    Present

  • @utkarshawasthi1665
    @utkarshawasthi1665 Před rokem

    Coding Prac Day 7 V3

  • @devilnk8475
    @devilnk8475 Před 2 lety

    Didi ...plz live stream ...

    • @codefromscratch-keertipurswani
      @codefromscratch-keertipurswani  Před 2 lety +1

      What should we discuss in live stream? Anything specific in mind?

    • @devilnk8475
      @devilnk8475 Před 2 lety

      @@codefromscratch-keertipurswani
      'Mam' if we have any doubts ask in live stream and we connect to directly...🥰🥰

  • @sravantipris3544
    @sravantipris3544 Před 10 měsíci

    good

  • @sachinaghera8189
    @sachinaghera8189 Před 2 lety +1

    Present