Showing 4 of 4 questions
Easy: 0
Medium: 0
Hard: 0
Overview
Bit manipulation involves direct manipulation of bits in binary representation. This section covers bitwise operators and their clever applications in solving problems efficiently.
Key Concepts
- Bitwise operators (AND, OR, XOR, NOT, shifts)
- Bit masks and flags
- Setting, clearing, and toggling bits
- Counting set bits
- Power of two checks
- XOR properties
Common Problems
Easy
- Single Number
- Number of 1 Bits
- Reverse Bits
- Power of Two
Medium
- Single Number II
- Single Number III
- Bitwise AND of Numbers Range
- Maximum XOR of Two Numbers
Hard
- Maximum XOR with an Element from Array
- Minimum XOR Sum of Two Arrays
Practice Tips
- Know operators: Master AND, OR, XOR, NOT, left/right shifts
- XOR properties: a ^ a = 0, a ^ 0 = a, commutative
- Bit tricks: Learn common patterns (isolate rightmost bit, etc.)
- Binary representation: Understand two’s complement