Bit Manipulation

Problems using bit manipulation techniques

34 lessons
92 min

Lessons

1. What is Bit Manipulation

Pattern overview

2m

2. Prerequisites

What you need first

1m

3. When to Use

Pattern triggers

2m

4. When NOT to Use

Avoid forcing this pattern

2m

5. LeetCode 136 Single Number - Problem Statement

The problem

2m1 problems

6. Quiz: XOR Property

Test your understanding

2m1 problems

7. LeetCode 136 Single Number - Solution

The core idea

3m

8. LeetCode 136 Single Number - Example and Complexity Analysis

Walkthrough and analysis

3m

9. LeetCode 136 Single Number - Implementation

The approach

4m1 problems

10. LeetCode 190 Reverse Bits - Problem Statement

The problem

2m1 problems

11. LeetCode 190 Reverse Bits - Solution

The core idea

3m

12. LeetCode 190 Reverse Bits - Example and Complexity Analysis

Walkthrough and analysis

3m

13. LeetCode 190 Reverse Bits - Implementation

The approach

4m1 problems

14. LeetCode 191 Number of 1 Bits - Problem Statement

The problem

2m1 problems

15. LeetCode 191 Number of 1 Bits - Solution

The core idea

3m

16. LeetCode 191 Number of 1 Bits - Example and Complexity Analysis

Walkthrough and analysis

3m

17. LeetCode 191 Number of 1 Bits - Implementation

The approach

4m1 problems

18. LeetCode 338 Counting Bits - Problem Statement

The problem

2m1 problems

19. LeetCode 338 Counting Bits - Why Naive Fails

The trap

2m

20. LeetCode 338 Counting Bits - Solution

The core idea

3m

21. LeetCode 338 Counting Bits - Example and Complexity Analysis

Walkthrough and analysis

3m

22. LeetCode 338 Counting Bits - Implementation

The approach

4m1 problems

23. LeetCode 371 Sum of Two Integers - Problem Statement

The problem

2m1 problems

24. Quiz: Bitwise Addition

Test your understanding

2m1 problems

25. LeetCode 371 Sum of Two Integers - Why Naive Fails

The trap

2m

26. LeetCode 371 Sum of Two Integers - Solution

The core idea

3m

27. LeetCode 371 Sum of Two Integers - Example and Complexity Analysis

Walkthrough and analysis

3m

28. LeetCode 371 Sum of Two Integers - Implementation

The approach

4m1 problems

29. LeetCode 421 Maximum XOR of Two Numbers - Problem Statement

The problem

3m1 problems

30. LeetCode 421 Maximum XOR of Two Numbers - Solution

The pattern

4m

31. LeetCode 421 Maximum XOR of Two Numbers - Example and Complexity Analysis

Walkthrough and analysis

3m

32. LeetCode 421 Maximum XOR of Two Numbers - Implementation

The code

4m1 problems

33. Common Mistakes

Common errors to avoid

2m

34. Section Recap

Summary

1m

Practice Problems

Ready to start learning?

Access all 34 lessons with interactive content and progress tracking.