Sum of Bit Differences Among All Pairs | Bit Manipulation Interview Questions

Please consume this content on nados.pepcoding.com for a richer experience. It is necessary to solve the questions while watching videos, nados.pepcoding.com enables that.
NADOS also enables doubt support, career opportunities and contests besides free of charge content for learning. In this problem, we discuss the problem Sum of Bit Differences using bit manipulation in JAVA. In this problem,
1. You are given an array of n numbers.
2. You have to find the sum of bit differences in all pairs that can be formed from n numbers.
3. Bit difference of two numbers is defined as the count of different bits at same positions in binary representations of two numbers.
To submit the question, click here: www.pepcoding.com/resources/d...
For a better experience and more exercises, VISIT: www.pepcoding.com/resources/o...
#bitmanipulation #bitmasking
Have a look at our result: www.pepcoding.com/placements
Follow us on our FB page: / pepcoding
Follow us on Instagram: / pepcoding
Follow us on LinkedIn: / pepcoding-education

Пікірлер: 42

  • @ujjawalgupta23
    @ujjawalgupta232 жыл бұрын

    Great Explanations!! Thank you very much Sir

  • @akatsuki1363
    @akatsuki13633 жыл бұрын

    Muze pahile laga tha bit manipulation bahot hard hoga pr abhi jab playlist khatam hone pe ayi he to easy lag raha thanks for efforts sir🔥❣️

  • @Pepcoding

    @Pepcoding

    3 жыл бұрын

    Thank you so much and If you like our efforts, please upvote the comments written by the students about Pepcoding here (www.quora.com/What-are-the-good-websites-to-learn-data-structures-and-algorithms )

  • @gautamjangir8927
    @gautamjangir89272 жыл бұрын

    Best explanation in the entire youtube....Thanks

  • @Pepcoding

    @Pepcoding

    2 жыл бұрын

    Glad you liked it! Keep learning. And for better experience, visit nados.io, where you will get well curated content and career opportunities.

  • @ajayjangid1164
    @ajayjangid1164 Жыл бұрын

    great explanation, just loved it!, Thank you sirji

  • @sportsbeauty4350
    @sportsbeauty43503 жыл бұрын

    Very easily understood... Thankyou sir..

  • @rahulbhatia3075
    @rahulbhatia30753 жыл бұрын

    Amazing sir, bhot maza aaya🔥

  • @udaysabbisetty9509
    @udaysabbisetty9509 Жыл бұрын

    Brilliant Explaination ,Thank you sumeet sir

  • @surajsingh-sm7qx
    @surajsingh-sm7qx2 жыл бұрын

    very very useful video

  • @ayaskanta100
    @ayaskanta1003 жыл бұрын

    gfg mein solution galat hai apne sahi bataya

  • @devankdubey6657
    @devankdubey66572 жыл бұрын

    sircan you explain 1

  • @play-chess
    @play-chess2 жыл бұрын

    बहुत वीडियो देखा इसके लिए, कोड तो मिल गया पर कोई सही से समझा नही पा रहा था, सब खाली कोड पढ़ रहे थे, इस वीडियो में समझ आया, O(n) कैसे हो गया 😊 धन्यवाद सर जी !

  • @Pepcoding

    @Pepcoding

    2 жыл бұрын

    बेहतर अनुभव और सुव्यवस्थित सामग्री के लिए - nados.io पर जाएँ और सीखना शुरू करें

  • @rohitshinde8478
    @rohitshinde84783 жыл бұрын

    Thank you sir for this amazing explaination

  • @Pepcoding

    @Pepcoding

    3 жыл бұрын

    Keep learning and keep growing😊 If you like our efforts, please upvote the comments written by the students about Pepcoding here (www.quora.com/What-are-the-good-websites-to-learn-data-structures-and-algorithms )

  • @shashwatkumar6965
    @shashwatkumar69655 ай бұрын

    4:50 the last x 2 is actually x 2!, because it counts all permutations of the 2 elements in the pair since order does not matter.

  • @geeky_world
    @geeky_world3 жыл бұрын

    super explanation....Thanks !

  • @Pepcoding

    @Pepcoding

    3 жыл бұрын

    Glad it was helpful! and If you like our efforts, please upvote the comments written by the students about Pepcoding here (www.quora.com/What-are-the-good-websites-to-learn-data-structures-and-algorithms )

  • @dpxy1599
    @dpxy15992 жыл бұрын

    गर्दा 🔥

  • @Live-hh6li
    @Live-hh6li3 жыл бұрын

    Thank You

  • @Pepcoding

    @Pepcoding

    3 жыл бұрын

    You're welcome

  • @abhinavgupta3913
    @abhinavgupta39133 жыл бұрын

    sir ek cheez clear nhi ho rhi ...hume countOn aur countOff ko long mei lena kyu pd rha h.....countOn ki value humesha arr.length se km ya equal honi chaiye ...or arr.length to integerRange mei hi rhega humesha

  • @muditjain7994

    @muditjain7994

    3 жыл бұрын

    Jab multiplication CPU register level pe perform hoti hai tab multiplication result temporarily operand me store kia jata hai. For example: A = B * C; when B will be multiplied with C then the result will be temporarily held in B then that temporary value will be copied in A and the original value will be set in B. So, if B * C exceeds Integer Range and could not be stored in B, the system gives an error. So, its better to take LONG and then typecast the result to INT after modulo 10^9 + 7 if the return type is INT. Hope this helps.

  • @somnathchakraborty1965
    @somnathchakraborty19653 жыл бұрын

    Great Explaination sir..

  • @Pepcoding

    @Pepcoding

    3 жыл бұрын

    Thankyou beta! I am glad you liked it. I hope that you are watching till the end and trying to understand what, how, and especially why of the problem. If you like our efforts, will you like to write a few words about us here (www.quora.com/What-are-the-good-websites-to-learn-data-structures-and-algorithms )

  • @anckoor
    @anckoor2 жыл бұрын

    very nice

  • @Pepcoding

    @Pepcoding

    2 жыл бұрын

    for better experience, visit nados.pepcoding.com, where you will get well curated content and career opportunities.

  • @nikhilmusale4730
    @nikhilmusale4730 Жыл бұрын

    Which algorithm is he suggesting? Something like kurnical algorithm, can someone clear it out (2:12 min)

  • @Pepcoding

    @Pepcoding

    Жыл бұрын

    kernighan algorithm

  • @adarshrai9516
    @adarshrai95163 жыл бұрын

    Sir apka speed pakd nhi paa raha hu time lag raha hai abhi foundation pe hi hu Foundation k saare questions solve kar raha hu

  • @Pepcoding

    @Pepcoding

    3 жыл бұрын

    Lage rahie. Jaldi Jaldi kijie.

  • @user-wo1tb9nz9u
    @user-wo1tb9nz9u4 ай бұрын

    ye 31 bits ka kyaa logic hai ?

  • @aasthajain92
    @aasthajain923 жыл бұрын

    Yeah questions kaunse subject mai aate hai

  • @PRABHATKUMAR-ek5cu

    @PRABHATKUMAR-ek5cu

    2 жыл бұрын

    Bit manipulation

  • @kunalkheeva
    @kunalkheeva Жыл бұрын

    well explained, but my code is working without multiplying with 2 as well.

  • @TuringTested01

    @TuringTested01

    Жыл бұрын

    that is because you are gay

  • @elasingh3151
    @elasingh31513 жыл бұрын

    This solution doesnt get pass in GeeksForGeeks

  • @mridulgupta9841

    @mridulgupta9841

    2 жыл бұрын

    use modulo there and store ans in long long int, it will work fine.

  • @indrajitbagchi7313
    @indrajitbagchi73136 ай бұрын

    i think considering ordered pairs is wrong

  • @ankitmishra399
    @ankitmishra3992 жыл бұрын

    thank u sir orz

  • @Pepcoding

    @Pepcoding

    2 жыл бұрын

    Most welcome, for better experience and well organised content visit - nados.pepcoding.com

Келесі