L4. Power Set | Bit Manipulation

แชร์
ฝัง
  • เผยแพร่เมื่อ 10 ก.พ. 2025
  • Notes/Codes/Problem links under day 8 of A2Z DSA Course: takeuforward.o...
    Follow us on our other social media handles: linktr.ee/take...

ความคิดเห็น • 78

  • @sachinvarma9949
    @sachinvarma9949 8 หลายเดือนก่อน +51

    never thought this problem can be solved by this approach

  • @arnabnath4782
    @arnabnath4782 8 หลายเดือนก่อน +10

    No one can explain this with that ease..wonderful 👏🏼👏🏼👏🏼👏🏼

  • @rajdeep3493
    @rajdeep3493 3 หลายเดือนก่อน +3

    watched it 3-4 times then i get the solution
    thanks man for explaining so nicely

  • @santoshkumak
    @santoshkumak 8 หลายเดือนก่อน +18

    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....

    • @yashwanthyerra2820
      @yashwanthyerra2820 4 หลายเดือนก่อน

      What's tricky in that bro ,simple looping it is . But explanation is what matters

  • @GopalGangoriya
    @GopalGangoriya 6 หลายเดือนก่อน +7

    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.

  • @nishchaypandit973
    @nishchaypandit973 11 หลายเดือนก่อน +16

    Brother i have my placement in 3 months plz continue this playlist

  • @dharanyuvi6951
    @dharanyuvi6951 2 หลายเดือนก่อน

    Love this problem and the way of solving it

  • @sarder681
    @sarder681 7 หลายเดือนก่อน +2

    striver its really deep knowledge .its hard to understand but code is simple and couple of lines.However understood boss.

  • @raghavmanish24
    @raghavmanish24 6 หลายเดือนก่อน +1

    mjhe to khud pe pura beleive hai ki kv na soch pata mai ye .....mind blowing solution......thanku striver

  • @DeepakKumar-nq4td
    @DeepakKumar-nq4td 5 หลายเดือนก่อน

    Garda ura diye bhaiya jii😂😂😂❤❤ tq

  • @stith_pragya
    @stith_pragya 9 หลายเดือนก่อน +1

    Understood.....Thank You So Much for this wonderful video............🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻

  • @Nikhil-xx5bh
    @Nikhil-xx5bh 5 หลายเดือนก่อน +1

    Take a bow 🏹 what an explanation 6:16

  • @vishnupandey3390
    @vishnupandey3390 5 หลายเดือนก่อน +2

    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

  • @jagadeesh6199
    @jagadeesh6199 6 หลายเดือนก่อน +11

    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

    • @projectalex8
      @projectalex8 6 หลายเดือนก่อน +3

      in which recursion video do we have creation of subsets?

    • @MusaafirSonu
      @MusaafirSonu 4 หลายเดือนก่อน

      @@projectalex8 Lecture 6

  • @AbhishekSharma-26
    @AbhishekSharma-26 8 หลายเดือนก่อน +8

    c++ code
    class Solution {
    public:
    vector subsets(vector& nums) {
    int n = nums.size();
    int subsett = 1

  • @unoshihaam
    @unoshihaam 10 หลายเดือนก่อน +7

    public static void main(String[] args) {
    int[] nums = {1,2,3};
    int subsets = 1

  • @SuvradipDasPhotographyOfficial
    @SuvradipDasPhotographyOfficial 7 หลายเดือนก่อน

    Awesome striver, amazing explanation

  • @lshuarckyma
    @lshuarckyma 2 หลายเดือนก่อน

    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

  • @codeman3828
    @codeman3828 10 หลายเดือนก่อน

    Understood. awesome video

  • @ssh3v
    @ssh3v 11 หลายเดือนก่อน +13

    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

    • @arunm619
      @arunm619 7 หลายเดือนก่อน +4

      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.

  • @pradeepkathey9290
    @pradeepkathey9290 หลายเดือนก่อน

    so grateful to u.....

  • @TechieClasher
    @TechieClasher 8 หลายเดือนก่อน

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

  • @jacobblack2544
    @jacobblack2544 5 หลายเดือนก่อน

    Hi striver chachu you are great.

  • @yaminireddy3321
    @yaminireddy3321 8 หลายเดือนก่อน

    understood in a easy way , thansks!!

  • @UECAshutoshKumar
    @UECAshutoshKumar 10 หลายเดือนก่อน +1

    Thank you 🙏

  • @jacobblack2544
    @jacobblack2544 5 หลายเดือนก่อน

    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!

  • @prabhakaran5542
    @prabhakaran5542 11 หลายเดือนก่อน +1

    Understood❤

  • @yhimanshu22
    @yhimanshu22 8 หลายเดือนก่อน

    All videos are very nice.

  • @gatsby.greatt
    @gatsby.greatt หลายเดือนก่อน

    11:53 The formula is n * 2^(n-1)

  • @shauryatomer1058
    @shauryatomer1058 5 หลายเดือนก่อน

    thanks for the great video

  • @mdseraj737_
    @mdseraj737_ 7 หลายเดือนก่อน

    Understood 😊 all

  • @durgasainathdora9900
    @durgasainathdora9900 11 หลายเดือนก่อน +1

    understood ❤

  • @arushikapoor05
    @arushikapoor05 6 หลายเดือนก่อน

    Python code:
    class Solution:
    def subsets(self, nums: List[int]) -> List[List[int]]:
    subset= (1

  • @NazeerBashaShaik
    @NazeerBashaShaik 9 หลายเดือนก่อน

    Understood, thank you.

  • @ayushp4471
    @ayushp4471 11 หลายเดือนก่อน

    Understood 😁❤️

  • @yogeshpatidar3529
    @yogeshpatidar3529 11 หลายเดือนก่อน

    Understood👍

  • @Learnprogramming-q7f
    @Learnprogramming-q7f 10 หลายเดือนก่อน

    Thank you Bhaiya

  • @jjjyotijain
    @jjjyotijain 10 หลายเดือนก่อน

    understood 😀

  • @SibiRanganathL
    @SibiRanganathL 6 หลายเดือนก่อน

    Novv mass na nee

  • @RithwikKoul
    @RithwikKoul หลายเดือนก่อน +1

    Which method would be more optimal: the recursive approach or the bit manipulation approach?

    • @Tbm4545
      @Tbm4545 24 วันที่ผ่านมา

      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

  • @shashankgsharma0901
    @shashankgsharma0901 7 หลายเดือนก่อน

    Understood!

  • @DeadPoolx1712
    @DeadPoolx1712 4 หลายเดือนก่อน

    UNDERSTOOD;

  • @OneStopSolution425
    @OneStopSolution425 2 หลายเดือนก่อน +1

    Can anybody share the video link where he has solved the problem using recursion approach?

  • @Tbm4545
    @Tbm4545 24 วันที่ผ่านมา

    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

  • @adityababu3405
    @adityababu3405 9 หลายเดือนก่อน +1

    #include
    vector subsequences(string str){

    vectorv;
    int n=str.length();
    int subset=(1

  • @yoddha621
    @yoddha621 4 หลายเดือนก่อน

    Looked like brute force, but its bit manipulation, so anyway it will be faster.

  • @Prawin142
    @Prawin142 7 หลายเดือนก่อน

    wtf is this method , never guessed this could be solved by this approach

  • @banothutharun2743
    @banothutharun2743 9 หลายเดือนก่อน

    Wow 🎉

  • @Shivi32590
    @Shivi32590 7 หลายเดือนก่อน

    thank you

  • @akashkumaryadav1827
    @akashkumaryadav1827 5 หลายเดือนก่อน

    🔥

  • @hardikpatel352
    @hardikpatel352 11 หลายเดือนก่อน

    Understood

  • @nayankhuman1043
    @nayankhuman1043 4 หลายเดือนก่อน

    understood :)

  • @shubham57641
    @shubham57641 11 หลายเดือนก่อน +3

    Bhiya ab india aa gaye ho video ki consistancy banae rakhna

  • @chirag71269
    @chirag71269 2 หลายเดือนก่อน

    STRIVER OG

  • @hiteshkumar-yl3se
    @hiteshkumar-yl3se 15 วันที่ผ่านมา

    where is the notes of this problem

  • @Braveuser-x7j
    @Braveuser-x7j 11 หลายเดือนก่อน

    nice

  • @siddheshpandey7905
    @siddheshpandey7905 8 หลายเดือนก่อน

    Which approach is better, recursive or bitwise one?

    • @ladimohanrao1067
      @ladimohanrao1067 7 หลายเดือนก่อน +1

      Any day bit manipulation takes less space

  • @navinchaudhary2812
    @navinchaudhary2812 11 หลายเดือนก่อน

    understood

  • @aditiapar9355
    @aditiapar9355 5 หลายเดือนก่อน

    what if the interviewer asks about the intuittion

  • @SumitKumar-qg4ps
    @SumitKumar-qg4ps 11 หลายเดือนก่อน

    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

  • @dhruvdonsahu9972
    @dhruvdonsahu9972 18 ชั่วโมงที่ผ่านมา

    this one was confusing

    • @dhruvdonsahu9972
      @dhruvdonsahu9972 4 ชั่วโมงที่ผ่านมา

      but i udnerstood,thanks

  • @tej.askamble
    @tej.askamble 8 หลายเดือนก่อน

    01/ 06 Revise

  • @khalasianiket816
    @khalasianiket816 7 หลายเดือนก่อน

    understood❤

  • @animeshkumar2683
    @animeshkumar2683 5 หลายเดือนก่อน

    Understood

  • @humanity7880
    @humanity7880 10 หลายเดือนก่อน

    understood

  • @rahuldhiman8760
    @rahuldhiman8760 หลายเดือนก่อน

    Thanks 🙏🏻

  • @anshsaxena7297
    @anshsaxena7297 4 หลายเดือนก่อน

    Understood

  • @ramakrishnakcr4417
    @ramakrishnakcr4417 9 หลายเดือนก่อน

    understood

  • @havefunwithshort
    @havefunwithshort 7 หลายเดือนก่อน

    understood