LeetCodechevron_rightCategorieschevron_rightbit manipulation
memory

bit manipulation

220 problems
Easy: 45Medium: 97Hard: 78

bit manipulation is one of the most repeated interview dimensions. Start with edge-safe fundamentals, then move into pattern-level trade-offs.

Interview Signal

Frequently tests problem modeling, edge handling, and verbal clarity.

Common Pitfall

Template-only answers break under follow-up questioning.

Practice Strategy

Practice in 3-5 problem rounds and always review complexity alternatives.

Recommended Progression

Problem bank

bit manipulation problem bank

Start with a compact scan-friendly list and progressively load more so the topic page stays readable even when the corpus is large.

Progressive topic library

Built for large topic sets: scan the structure first, then go deeper.

hourglass_bottomScroll to continue
search
tuneDifficulty

Showing 24 / 220 problems

+24 per load
#TitleDifficulty
29

Divide Two Integers

Solve Divide Two Integers by turning repeated subtraction into bit-shifted chunk subtraction with careful sign and overf…

Medium
67

Add Binary

Add Binary involves summing two binary strings and returning the result as a binary string using math and string manipul…

Easy
78

Subsets

Generate all subsets of a set of unique integers using backtracking with pruning to avoid duplicates.

Medium
89

Gray Code

Generate an n-bit Gray Code sequence using backtracking with pruning and bit manipulation techniques.

Medium
90

Subsets II

Subsets II problem asks to generate unique subsets from an array with possible duplicates using backtracking search with…

Medium
136

Single Number

Solve the Single Number problem using an efficient approach with constant space and linear time complexity.

Easy
137

Single Number II

Find the single element in an array where every other element appears three times, using bit manipulation and constant s…

Medium
187

Repeated DNA Sequences

Solve Repeated DNA Sequences by sliding a length-10 window and tracking seen patterns with a hash set or bitmask.

Medium
190

Reverse Bits

Reverse a 32-bit unsigned integer by manipulating bits efficiently using a divide and conquer approach with careful bit …

Easy
191

Number of 1 Bits

Number of 1 Bits is a classic bit manipulation problem where clearing the lowest set bit gives the cleanest count.

Easy
201

Bitwise AND of Numbers Range

Use shared high bits and bit clearing to solve Bitwise AND of Numbers Range without scanning every value.

Medium
222

Count Complete Tree Nodes

Count Complete Tree Nodes efficiently by leveraging binary-tree traversal, exploiting completeness, and applying bit man…

Easy
231

Power of Two

Determine if a given integer is a power of two using efficient math and bit manipulation techniques with optional recurs…

Easy
260

Single Number III

Find the two unique numbers in an array where all other numbers appear exactly twice using bit manipulation efficiently.

Medium
268

Missing Number

Find the missing number in an array containing distinct numbers in the range [0, n].

Easy
287

Find the Duplicate Number

The problem involves finding the duplicate number in an array of integers, using a binary search approach over the valid…

Medium
318

Maximum Product of Word Lengths

The problem requires finding the maximum product of lengths of two words from an array, where the words don't share comm…

Medium
338

Counting Bits

Compute the number of 1 bits for every integer from 0 to n using state transition dynamic programming for efficiency.

Easy
342

Power of Four

Determine if a given integer is a power of four using math insights and bit manipulation tricks efficiently in code.

Easy
371

Sum of Two Integers

Solve the Sum of Two Integers problem using bit manipulation and math to avoid using the operators + and -.

Medium
389

Find the Difference

Find the Difference involves identifying the additional letter in one string compared to another, emphasizing hash table…

Easy
393

UTF-8 Validation

Determine if an integer array represents valid UTF-8 encoding based on its byte sequences using bit manipulation.

Medium
397

Integer Replacement

Find the minimum number of operations to reduce a number to 1 by applying specific operations, using state transition dy…

Medium
401

Binary Watch

Binary Watch involves generating possible times on a binary watch given a number of turned-on LEDs.

Easy

swap_vertScroll inside the bank to auto-load more

Related Patterns

Bit Manipulation LeetCode Problems: 220 Solutions