Bit Tricks

XOR pairing, masks as sets, n & (n-1), two's-complement tricks.

1 min readInterview · DSA Patterns

A small toolbox of bit-level tricks that show up in interview problems where the input is "numbers" but the algorithm is really about the bits.

Finished reading?

Mark it done to track your progress in Interview.

On this page

No Headings