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 : Number of substrings with each character occurring even times - GeeksforGeeks

and similar to this : https://leetcode.com/contest/weekly-contest-247/problems/number-of-wonderful-substrings/

@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.
https://www.codechef.com/problems/MARCHA1
https://www.codechef.com/problems/BESTBATS

2 Likes

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

1 Like