Bit Manipulation

Work directly with the binary digits of numbers, using AND, OR, XOR and shifts. The tell is a space limit, a pair-cancelling property or powers of two, as in Single Number. It often gives constant space and very little code.

15 problems · 8 with a video · 3 to practice in an AI round

Bit Manipulation problems
#ProblemDifficultyVideoAI round
1Single NumberVery easyAI round
2Add BinaryEasy—AI round
3Single Number IIMediumAI round
4Power of TwoEasy
5Number of 1 BitsEasy
6Single Number IIIMedium
7Divide Two IntegersMedium
8Reverse BitsEasy—
9Set MismatchEasy—
10Find the DifferenceEasy—
11Number of Steps to Reduce a Number to ZeroVery easy—
12K-th Symbol in GrammarMedium—
13Minimum Bit Flips to Convert NumberVery easy
14XOR Operation in an ArrayVery easy
15Palindrome PermutationEasy—

Practice in an AI round

Three of these are AI rounds: 30 minutes, an AI agent beside your code, then a scored report.

Practice Single Number in an AI round