Bit Manipulation
Bit manipulation treats an integer as a row of switches. Many problems get simple once you look at one bit at a time: XOR cancels pairs, AND can only lose bits, and OR can only gain them.
The nine chapters start with the basics, cover XOR and AND/OR properties, splitting a problem bit by bit, trial filling from the highest bit down, bitwise identities and linear basis, then end with constructive and mixed problems. It suits anyone who tends to skip bit problems and wants a set of them in a sensible order.
Want company while you work through this list? Sign in, open the study room, and your heroine will bring you the problems one at a time.
I. Fundamentals
I. Fundamentals
II. XOR Properties
II. XOR Properties
III. AND / OR Properties
III. AND / OR Properties
IV. Bit Contribution & Splitting
IV. Bit Contribution & Splitting
V. Trial Filling Technique
V. Trial Filling Technique
VI. Bitwise Identities
VI. Bitwise Identities
| Problem | Rating |
|---|---|
| 1835. Find XOR Sum of All Pairs Bitwise AND | 1825 |
| 2354. Number of Excellent Pairs | 2076 |
VII. Linear Basis
VII. Linear Basis
| Problem | Rating |
|---|---|
| 3681. Maximum XOR of Subsequences | Unrated |
| 3630. Partition Array for Maximum XOR AND AND | 2744 |
VIII. Constructive Bit Problems
VIII. Constructive Bit Problems
IX. Miscellaneous
IX. Miscellaneous
It comes fifth on Track 1, after Data Structures, but the order is only a suggestion, so you can open it from the full catalog whenever you like.
Ratings come from zerotrac's LeetCode contest ratings. Some problems have no zerotrac rating and are marked Unrated.
Open the study room