Paths Subjects Questions Quizzes Pricing Search
Algorithms & Data Structures Intermediate Pro

Bit Manipulation

Trade hash sets and extra memory for a handful of bitwise tricks

20 min read 1 view

Learn the core bitwise operators and the small set of identities — XOR cancellation, n & (n-1), n & -n — that unlock O(1)-space solutions to classic interview problems. Covers counting set bits with DP, finding a lonely element with XOR, and rearranging bits with masks and shifts.

Practice questions (3)

  • Hamming Weights of Integers

    Intermediate
    View →
  • Lonely Integer

    Beginner
    View →
  • Swap Odd and Even Bits

    Advanced
    View →

We use cookies for product analytics to improve OmniAtlas. See our Privacy Policy.