This problem looks very easy from explanation but after he writes code and mapping back to explanation you will know how tricky it is.... Kudos to you for putting this explanation and solution....
00:04 Printing all subsets using power set technique 01:37 Power set is the number of subsets 03:16 Using simple Boolean logic to generate power set 04:54 Creating subsets using bit manipulation 06:27 Iterate and generate subsets using bit manipulation. 07:59 Generating power set using bit manipulation 09:34 Generating power set using bit manipulation. 11:14 Discussing space complexity and subset sizes in power set generation.
broo, i came after that recursion playlist only, there you are telling to watch bit manipulation playlist and here you are telling to watch recursion playlist🤭🤭😂🤣, btw you are the best thooo
the observation that take set bit of 2^n index in input array as member of a subset is very theoretical & observation intensive and hard to come up with , if we have seen never before, how to deal with it @take U forward
no other way brother. Its not like one can discover fire ourselves every time one is born. There are somethings in life that we pick it up as we learn and grow.
Bruh, wonderful! , sorry I did not subscribe until now, i mean im following u from a yr, but never saw the subscribe button idk how. uff. DID IT NOW :)
fan eko naar daa mai, das vaari vaarda mai, ohde utton 100-100 diyaan gatthiyaan. Time laggu mitne nu, saanu thalle sittne nu, ikki vaari zor laale chattiyaan!
So u have not seen the complete video, he has told both the method uses same TC but since in rec we need a call stack this uses less SC than the rec method
never thought this problem can be solved by this approach
No one can explain this with that ease..wonderful 👏🏼👏🏼👏🏼👏🏼
watched it 3-4 times then i get the solution
thanks man for explaining so nicely
This problem looks very easy from explanation but after he writes code and mapping back to explanation you will know how tricky it is....
Kudos to you for putting this explanation and solution....
What's tricky in that bro ,simple looping it is . But explanation is what matters
00:04 Printing all subsets using power set technique
01:37 Power set is the number of subsets
03:16 Using simple Boolean logic to generate power set
04:54 Creating subsets using bit manipulation
06:27 Iterate and generate subsets using bit manipulation.
07:59 Generating power set using bit manipulation
09:34 Generating power set using bit manipulation.
11:14 Discussing space complexity and subset sizes in power set generation.
Brother i have my placement in 3 months plz continue this playlist
All the best!
Love this problem and the way of solving it
striver its really deep knowledge .its hard to understand but code is simple and couple of lines.However understood boss.
mjhe to khud pe pura beleive hai ki kv na soch pata mai ye .....mind blowing solution......thanku striver
Garda ura diye bhaiya jii😂😂😂❤❤ tq
Understood.....Thank You So Much for this wonderful video............🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻
Take a bow 🏹 what an explanation 6:16
nums=[1,2,3]
length=len(nums)
upper=(2**length)-1
sup_set=list()
for i in range(upper,-1,-1):
ans=list()
for j in range(length):
mask=1
broo, i came after that recursion playlist only, there you are telling to watch bit manipulation playlist and here you are telling to watch recursion playlist🤭🤭😂🤣, btw you are the best thooo
in which recursion video do we have creation of subsets?
@@projectalex8 Lecture 6
c++ code
class Solution {
public:
vector subsets(vector& nums) {
int n = nums.size();
int subsett = 1
public static void main(String[] args) {
int[] nums = {1,2,3};
int subsets = 1
Awesome striver, amazing explanation
the space complexity will be O(2^n) as 2^n is the sum of all the lengths of all the temp lists that will be created
Understood. awesome video
the observation that take set bit of 2^n index in input array as member of a subset is very theoretical & observation intensive and hard to come up with , if we have seen never before, how to deal with it @take U forward
no other way brother. Its not like one can discover fire ourselves every time one is born. There are somethings in life that we pick it up as we learn and grow.
so grateful to u.....
Bruh, wonderful! , sorry I did not subscribe until now, i mean im following u from a yr, but never saw the subscribe button idk how. uff. DID IT NOW :)
Hi striver chachu you are great.
understood in a easy way , thansks!!
Thank you 🙏
fan eko naar daa mai, das vaari vaarda mai, ohde utton 100-100 diyaan gatthiyaan. Time laggu mitne nu, saanu thalle sittne nu, ikki vaari zor laale chattiyaan!
Understood❤
All videos are very nice.
11:53 The formula is n * 2^(n-1)
thanks for the great video
Understood 😊 all
understood ❤
Python code:
class Solution:
def subsets(self, nums: List[int]) -> List[List[int]]:
subset= (1
is this correct
Understood, thank you.
Understood 😁❤️
Understood👍
Thank you Bhaiya
understood 😀
Novv mass na nee
Which method would be more optimal: the recursive approach or the bit manipulation approach?
So u have not seen the complete video, he has told both the method uses same TC but since in rec we need a call stack this uses less SC than the rec method
Understood!
UNDERSTOOD;
Can anybody share the video link where he has solved the problem using recursion approach?
I got the solution that how ur getting the subsequence but how is that final list ur storing in ans ? What data struc is that ans
#include
vector subsequences(string str){
vectorv;
int n=str.length();
int subset=(1
Looked like brute force, but its bit manipulation, so anyway it will be faster.
wtf is this method , never guessed this could be solved by this approach
Wow 🎉
thank you
🔥
Understood
understood :)
Bhiya ab india aa gaye ho video ki consistancy banae rakhna
STRIVER OG
where is the notes of this problem
nice
Which approach is better, recursive or bitwise one?
Any day bit manipulation takes less space
understood
what if the interviewer asks about the intuittion
That extra n in space can be easily optimized as
int n = v.size();
n = pow(2,n);
vectorans(n);
for(int i = 0; i
this one was confusing
but i udnerstood,thanks
01/ 06 Revise
understood❤
Understood
understood
Thanks 🙏🏻
Understood
understood
understood