2220. Minimum Bit Flips to Convert Number | Leetcode Daily (POTD) 11 Sep 2024 | Java | Hindi

Поділитися
Вставка
  • Опубліковано 3 лис 2024

КОМЕНТАРІ • 18

  • @soomann2716
    @soomann2716 Місяць тому +1

    Create a playlist to teach dsa to a person who don't know anything from scrqtch...it would be awesome to know how much he learned

  • @harishbehera7812
    @harishbehera7812 Місяць тому +1

    thanx.for solving the problem its really helpful

  • @AyushKumar-lr9po
    @AyushKumar-lr9po Місяць тому +1

    Great dude Keep going soon you will reach 10K , 100k , 200k … so on. Just be consistent. Your voice is also catchy.

  • @worldcurrenttimes7350
    @worldcurrenttimes7350 Місяць тому +1

    I respect you❤❤❤

  • @anuragdubey8169
    @anuragdubey8169 Місяць тому +1

    or we can also perform the XOR operation and then count the set bits directly,
    ```
    int minBitFlips(int start, int goal) {

    bitset binary(start^goal);
    return binary.count(); // counts and returns set bits
    }
    ```

    • @LeetCodeIO-Anuj
      @LeetCodeIO-Anuj Місяць тому

      You can xor and calculate the set bits using brian kernighan algorithm. I have posted a video using this approach. Its more optimised than calculating the set bits using this method.

    • @anuragdubey8169
      @anuragdubey8169 Місяць тому +1

      @@LeetCodeIO-Anuj Just checked your video. It's indeed an interesting approach that I wasn't aware of.
      Thank you for your response.

    • @LeetCodeIO-Anuj
      @LeetCodeIO-Anuj Місяць тому

      @@anuragdubey8169 Brian Kernighan is indeed one of the most common algorithm while solving bits related problems.

    • @algorithmsbyaditi
      @algorithmsbyaditi  Місяць тому

      Great work !

  • @aditya_raj7827
    @aditya_raj7827 Місяць тому +2

    done mam 😊😊

  • @CarryMinati-dq8fg
    @CarryMinati-dq8fg Місяць тому +1

    Big fan of your consistency every day your new video got recommended but unfortunately i have leraned cpp is there is any good playlist of cpp in yt of hackrank or leetcode

    • @algorithmsbyaditi
      @algorithmsbyaditi  Місяць тому

      Thank youu, I am not aware of any channel which posts daily challenge video in cpp

  • @rahulsinghrajput5139
    @rahulsinghrajput5139 Місяць тому +1

    how did you approach this question using your intuition
    I’d love to hear more about your thought process

    • @algorithmsbyaditi
      @algorithmsbyaditi  Місяць тому

      Just counting the number of bits which are different will do the work