1863. Sum of All Subset XOR Totals | Bit Manipulation | Generating Subsets | Xor | 3 Approaches

แชร์
ฝัง
  • เผยแพร่เมื่อ 18 พ.ค. 2024
  • In this video, I'll talk about how to solve Leetcode 1863. Sum of All Subset XOR Totals | Bit Manipulation | Generating Subsets | Xor
    BackTracking Crash Course - • Subsets II Permutation...
    Bit Manipulation Crash Course - • BIT MANIPULATION Crash...
    Let's Connect:
    📱Discord (Join Community) : / discord
    📝Linkedin: / aryan-mittal-0077
    📸 Instagram: / codewitharyanbhai
    💻 Twitter - / aryan_mittal007
    🤖 Github: github.com/aryan-0077
    About Me:
    I am Aryan Mittal - A Software Engineer in Goldman Sachs, Speaker, Creator & Educator. During my free time, I create programming education content on this channel & also how to use that to grow :)
    ✨ Hashtags ✨
    #programming #Interviews #leetcode #faang #maang #datastructures #algorithms

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

  • @ARYANMITTAL
    @ARYANMITTAL  24 วันที่ผ่านมา +2

    Of course not an easy one, if this comes in an interview & Interviewer expects 3rd approach, then best of luck from my side if you have not seen the video 👍🌚
    .
    Money Laundering & Drug Trafficking Scam with me - th-cam.com/video/beTytS3WhS0/w-d-xo.html

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

    TYSM for the explaination.

  • @ravipatel-xu5qi
    @ravipatel-xu5qi 23 วันที่ผ่านมา

    thank you Aryan for putting effort everyday. A small request, it will be really helpful if you can put chapter into your video. So that we can jump between the sections easily and can watch the specific part. Here if you are explaining approches ,than better to have chapters based on that.
    Thank you.

  • @abishekupadhyay6357
    @abishekupadhyay6357 23 วันที่ผ่านมา

    amazing explanation sir.

  • @cenacr007
    @cenacr007 20 วันที่ผ่านมา

    ❤️

  • @rohita6532
    @rohita6532 23 วันที่ผ่านมา

    if someone struggling in last explanation they can see neetcode solution video he explained in short and easy way

  • @RohanSharma-tl9wh
    @RohanSharma-tl9wh 24 วันที่ผ่านมา

    pooja ghanti at 11:00

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

    Thnk you for the explanation. However, I'm not really convinced with the contribution of every bit to be 2 ^ (n-1) you didn't show the formal proof, just an intuition based on a example.

    • @ARYANMITTAL
      @ARYANMITTAL  24 วันที่ผ่านมา +3

      Ohh that's one liner after this example.
      Imagine ith bit of those n numbers are like 11000.....11010 i.e x 1's & y 0's at the ith bit, now this ith bit will have 1 in the end after doing xor only when 1 is occuring odd number of times, which is same way saying find me the number of subsets having odd number of 1s.
      Its counter proof is available here (Number of subsets with even number of ones = Number of subsets with odd number of ones) - math.stackexchange.com/questions/1338787/number-of-subsets-with-even-number-of-elements

    • @ITACHIUCHIHA-dr8sz
      @ITACHIUCHIHA-dr8sz 24 วันที่ผ่านมา +1

      //find contribution of each bit in sum
      // let k elements have the ith bit set
      // ways1 = ways to choose ith bit not set = 2^(n - k)
      // ways2 = ways to choose ith bit set = kC1 + kC3 + kC5... kCk => 2 ^ (k - 1) since xor of odd count of 1's would contribute to ans
      // total ways = ways1 * ways2 = 2 ^(n - 1)
      // total contribution to ans = totalways * each way contribution which is (1

  • @KADOfficial23
    @KADOfficial23 23 วันที่ผ่านมา +1

    kya bol rha hai kuch samajh mein nhi aa rha hai

  • @asimshah1824
    @asimshah1824 23 วันที่ผ่านมา

    The tf is the leetcode easy