• Home
  • Learn
  • Feed
  • Ladder
  • Saved
← Roadmapsall bit manipulation problems
💡

Bit Manipulation

Counting bits, XOR tricks, powers, masks.

5 stops · 116 problems0/70 on the path done
next ▸ Is Bit SetSilver · 1000
1

Counting & complement

0/16 of 32you are here

Hamming weight, counting bits, complement.

○Is Bit Set○Number of 1 Bits○Set Bit○Number Complement○Hamming Weight○Counting Bits 0 to N○Clear Bit○Prime Number of Set Bits○Set Bit at Index○Find Complement○Clear Bit at Index○Counting Bits Array○Complement of Base 10 Integer○Bit Parity Check○Clear Lowest Set Bit○Get Nth Bit+16 in the arena
2

XOR tricks

0/16 of 26

Single/missing number, XOR of range, subsets.

○Decode the XORed Array○Swap Without Temp○Decode XORed Array○Sum of Subset XOR Totals○XOR of Range○XOR of All Elements○XOR Prefix Queries○XOR Operation in Array○Missing Number○Xor Of Range Zero N○XOR Queries of a Subarray○Count Pairs with XOR in Range○XOR of All Pairwise XORs○Single Number II○XOR of a Range○Single Number (Others Thrice)+10 in the arena
3

Powers & distance

0/11

Power of two/three/four, hamming distance, gray.

○Alternating Bits○Power of Two○Gray Code to Binary○Hamming Distance○Highest Power Of Two Floor○Gray Code Encode○Next Power Of Two Ceiling○Gray Code Decode○Power of Four○Total Hamming Distance○Gray Code
4

Counting & combos

0/11

Prime set bits, steps to zero, flips, max xor.

○Number of Steps to Reduce to Zero○Minimum Bit Flips to Convert○Binary Watch Times○Minimum Flips for a OR b == c○Minimum Bit Flips○Steps to Reduce Binary to One○Binary Watch Count○Min Flips to Make OR Equal○Largest Combination With Bitwise AND○Concatenation of Binary Numbers○Min Flips For OR
5

More Bit Manipulation

0/16 of 36

Everything else in this category — keep climbing.

○Get Bit○Total Subsets via Bitmask○Bits to Flip A into B○Bit Difference Count○Bitwise AND of Numbers Range○Read Bit At Index○Turn On Bit At Index○Toggle Bit At Index○Turn Off Bit At Index○Non-Empty Subsets Count○Longest Subarray with Maximum AND○Maximum Binary Gap○Swap Byte Nibbles○Count Trailing Zero Bits○Subset Sum Count via Bitmask○Distinct Subset Sums+20 in the arena
🏁Finish line