(Remade) Subsets I | Leetcode 78 | Backtracking
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)
The first person to enable me to see this problem clearly. You have a gift for speech.
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. 👏👏👏
Thanks Chiranjeevi. Btw, I am a megastar fan
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
Specifically calling attention to the recursive "branches" separates this video from similar attempts to explain backtracking. Thank you!
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!
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.
Alright the explanation is damn good and you promptly remade this video. Thanks a lot!💯💯
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!
Ohhh man.. Where you have been this long... 😊🤟 Great explanation 📌
watched 8+ vids and this is the one that actually made sense thank you
Best explanation of this problem on youtube. Went through all my usual guys, but they all flopped this question. Earned a sub
beautiful explanation! i was struggling with backtracking and this cleared everything up.
This is the best explanation I came across. Most of the people just eat and spit out the solution.
thanks!
best explanation on CZcams so far
Awesome, man! Thumbs up!
Thanks for the quality explanation of the problem. Much appreciated
my pleasure
Love the video!
Useful video, thanks dude!
Welcome man
I am hardly managing to not spam compliments in capslock here. This explanation was absolutely amazing.
Wow thanks Max!
Exceptional, thanks a lot
super clear. thank…i checked out many video non as clear as yours
Appreciate it
very good explanation .
I love you Nideesh
great! thanks
where do we check for duplicates in this approach ?
what does List means exactly
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);
}
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)
He is looking exactly like rajkumar Rao😂😂
You look like Rajkumar Rao from Bollywood