BitMasking resources and problems [Beginner to Intermediate]

Hii all , I want to learn Bitmasking , can anyone please share some good resources to learn from beginner to intermediate/advanced , I don’t need DP+Bitmask , I just need bitmasking learning resources , and some good easy to medium questions to start.

as today I encountered one of problem :

and similar to this :

@cubefreak777 @ssjgz @galencolin

I don’t seem to find a resource that covers all standard tricks of bit masking & bit manipulation. Most people learn those standard tricks by solving problems related to them. I’ll try to dot down a few of the techniques coming to my mind.

  1. Prefix Xor trick which you mentioned → Problem Link
  2. Standard Bit contribution trick → 1.RGAND 2. XORIT 3.PAND
  3. Binary trie transformation in XOR problems → Problem Link

I’ll add on to this list whenever I find something worth adding to it. Also since we’re discussing bit masking here’s a very nice document that covers a lot of hacks under bit manipulation I highly recommend checking it out → Bit Manipulation Hacks

1 Like

ok buddy let me check and try to learn they are beginner friendly na like me ?

Yes, they’re intermediate-level concepts, you should be able to do learn them comfortably. These 2 easy problems are also worth trying out.


Ok thanks man , surely will try , and not able to solve then will ask here . thanks.

1 Like