(Remade) Subsets I | Leetcode 78 | Backtracking

Sdílet
Vložit
  • čas přidán 25. 07. 2024
  • Topic: Backtracking
    Code:
    github.com/Nideesh1/Algo/blob...
    Leetcode:
    leetcode.com/problems/subsets/
    Note I claim no rights to this question. All rights belong to Leetcode. The company tags in the video title are tagged by Leetcode. If I'm reviewing a solution that was from another Leetcode user or Leetcode itself I will give credit below.
    Credit to : Leetcode User issac3 | leetcode.com/problems/subsets...
    Intro:(0:00)
    Input/Output/Approach:(0:10)
    Higher Level:(4:44)
    Code:(6:57)
    Complexities:(8:00)
    Hey there! Just wanted to let you know that some of the below links in this video description are affiliate links, which means that if you make a purchase through them, I may earn a small commission. Don't worry though, it doesn't cost you anything extra and it helps support this channel so I can continue to make more videos for you. Thank you so much for your support, and as always, all opinions are my own!
    Start getting great at system design: bytebytego.com?fpr=nideesh (affiliate link)
    Handpicked Algorithms and Data Structures for Interview To Save Time: interviewpen.com/?via=nideesh (affiliate link)
    Fast track to becoming a knowledgeable SWE www.educative.io/unlimited?af... (affiliate link)

Komentáře • 38

  • @MakingVidsBreh
    @MakingVidsBreh Před rokem +2

    The first person to enable me to see this problem clearly. You have a gift for speech.

  • @chiranjeevipippalla
    @chiranjeevipippalla Před 3 lety +9

    There are videos on this topic with 26 minutes duration explaining just the tree diagram without any code. Everyone can explain the tree diagram but connecting the diagram with the code is the reason why we come to watch a video. This guy connected the two in under 10 minutes. 👏👏👏

  • @tpsspace7397
    @tpsspace7397 Před 3 dny +1

    wow this video helped me so much, seeing it draw on a whiteboard and more in person is so much more helpful then looking at the code myself

  • @ChadS44
    @ChadS44 Před 3 lety +5

    Specifically calling attention to the recursive "branches" separates this video from similar attempts to explain backtracking. Thank you!

  • @binetlee2534
    @binetlee2534 Před 3 lety +3

    This is the best way I've seen the Subset problem logic drawn out, conceptualized, and converted into code. You nailed it with this explanation - super helpful!

  • @jelliott1458
    @jelliott1458 Před 3 lety +1

    By far the best explanation I've seen. The recursive tree helped immensely with understanding the reason for the remove after returning from the stack call.

  • @vasachisenjubean5944
    @vasachisenjubean5944 Před 4 lety +4

    Alright the explanation is damn good and you promptly remade this video. Thanks a lot!💯💯

  • @fantasy9960
    @fantasy9960 Před rokem +1

    Please please please make more videos! I have watched many Q78 videos, but yours is definitely the best and structured overall! Thank you so much sir!

  • @sivakumarg98
    @sivakumarg98 Před 3 lety +2

    Ohhh man.. Where you have been this long... 😊🤟 Great explanation 📌

  • @AK09037
    @AK09037 Před 3 lety

    watched 8+ vids and this is the one that actually made sense thank you

  • @sofoboachie5221
    @sofoboachie5221 Před 3 lety

    Best explanation of this problem on youtube. Went through all my usual guys, but they all flopped this question. Earned a sub

  • @michael3620
    @michael3620 Před 3 lety

    beautiful explanation! i was struggling with backtracking and this cleared everything up.

  • @ragavnitinpande5612
    @ragavnitinpande5612 Před 3 lety +1

    This is the best explanation I came across. Most of the people just eat and spit out the solution.

  • @rickzheng8948
    @rickzheng8948 Před 3 lety

    best explanation on CZcams so far

  • @kdvr60
    @kdvr60 Před 4 lety

    Awesome, man! Thumbs up!

  • @josephyang2183
    @josephyang2183 Před 2 lety

    Thanks for the quality explanation of the problem. Much appreciated

  • @niharikapatil902
    @niharikapatil902 Před 2 lety

    Love the video!

  • @DyiLuaN
    @DyiLuaN Před 4 lety +1

    Useful video, thanks dude!

  • @Mexximillion
    @Mexximillion Před 3 lety

    I am hardly managing to not spam compliments in capslock here. This explanation was absolutely amazing.

  • @TheProximator
    @TheProximator Před 3 lety

    Exceptional, thanks a lot

  • @tarankaranth8782
    @tarankaranth8782 Před 2 lety

    super clear. thank…i checked out many video non as clear as yours

  • @abhinay4200
    @abhinay4200 Před 2 lety

    very good explanation .

  • @JannibalForKing
    @JannibalForKing Před rokem

    I love you Nideesh

  • @baihongli4512
    @baihongli4512 Před 3 lety

    great! thanks

  • @rishmithahahaha
    @rishmithahahaha Před 2 lety

    where do we check for duplicates in this approach ?

  • @sahilmehra290
    @sahilmehra290 Před 2 lety

    what does List means exactly

  • @shiladityadey8376
    @shiladityadey8376 Před 3 lety

    I thought collecting from the leaves makes it more intuitive. You seem to be collecting every time control comes to line#3 in your code.
    public static void combination1(int[] input, int i, List result, List path) {
    if (i == input.length) {
    result.add(new LinkedList(path));
    return;
    }
    path.add(input[i]);
    combination1(input, i + 1, result, path);
    path.remove(path.size() - 1);
    combination1(input, i + 1, result, path);
    }

  • @NideeshTerapalli
    @NideeshTerapalli  Před rokem

    Hey there! Just wanted to let you know that some of the links in this comment are affiliate links, which means that if you make a purchase through them, I may earn a small commission. Don't worry though, it doesn't cost you anything extra and it helps support this channel so I can continue to make more videos for you. Thank you so much for your support, and as always, all opinions are my own!
    Start getting great at system design: bytebytego.com?fpr=nideesh (affiliate link)
    Handpicked Algorithms and Data Structures for Interview To Save Time: interviewpen.com/?via=nideesh (affiliate link)
    Fast track to becoming a knowledgeable SWE www.educative.io/unlimited?aff=K1z6 (affiliate link)

  • @nitishsingh3470
    @nitishsingh3470 Před 3 lety

    He is looking exactly like rajkumar Rao😂😂

  • @nilaysheth3283
    @nilaysheth3283 Před 3 lety +1

    You look like Rajkumar Rao from Bollywood