#119

Поділитися
Вставка
  • Опубліковано 28 тра 2024
  • 🚀 Solving Geeks for Geeks Problem of the Day(POTD) in C++ | Sum of Products | Intuition Explained🧠
    Problem Statement : www.geeksforgeeks.org/problem...
    Solution Code : github.com/Masked-coder11/gfg...
    Count-inversion: • Love Babar DSA sheet |...
    Count-inversion code:github.com/Masked-coder11/Lov...
    🌐 Connect with Me:
    GitHub: github.com/Masked-coder11
    Instagram: garg.yugayu...
    Linkedin: www.linkedin.com/in/yugayu-garg-47a001225
    Join my discord Server: / discord
    💬 Have questions or suggestions? Drop them in the comments below! Let's learn and grow together. Happy coding! 👨‍💻
    #GFG #POTD #geeksforgeeks #problemoftheday #c++

КОМЕНТАРІ • 15

  • @user-vo3fr5qb6v
    @user-vo3fr5qb6v Місяць тому +1

    could you please explain why are we left shifting corresponding to the index value like 1

    • @maskedcoder-dy1ub
      @maskedcoder-dy1ub  Місяць тому

      This is done so as to add the number of pairs at that particular set bit

    • @Krishna-in1hy
      @Krishna-in1hy Місяць тому

      ​@@maskedcoder-dy1ubCould you elaborate with an example

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

    Great explanation!

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

    ans+= (1

    • @maskedcoder-dy1ub
      @maskedcoder-dy1ub  Місяць тому

      Yes 2^i will also work
      Is it not working??

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

      @@maskedcoder-dy1ub (2^i) it is (2xor with i) not the 2 to the power i

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

      @@rajasthaniboy888 bro he means 2**i.....1

    • @maskedcoder-dy1ub
      @maskedcoder-dy1ub  Місяць тому

      I meant power

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

      @@maskedcoder-dy1ub yes that is working, 2 raised to the power i,
      my doubt is why are we multiplying with this in the first place...

  • @user-vk8db3ph2v
    @user-vk8db3ph2v Місяць тому

    sorry to say that today video was not helpful for me even i did not get the concept , i watched this video three time🙃

    • @maskedcoder-dy1ub
      @maskedcoder-dy1ub  Місяць тому

      Oh! Sorry to hear that
      Like can you pinpoint where did you faced difficulty, maybe I can explain you

    • @user-vk8db3ph2v
      @user-vk8db3ph2v Місяць тому

      In the second optimal approach, the step when u start left shifting and the whole part after shifting I didn't understand

    • @maskedcoder-dy1ub
      @maskedcoder-dy1ub  Місяць тому

      See at any bit what is the number getting added:-> the number of pairs of set bits because we have been given bitwise and sums.
      now to add anything at any but we will have to multiply by (1