Bit Manipulation Pattern

Use bits as compact sets or arithmetic shortcuts.

#Title
136Single Number
137Single Number II
190Reverse Bits
191Number of 1 Bits
201Bitwise AND of Numbers Range
231Power of Two
260Single Number III
268Missing Number
318Maximum Product of Word Lengths
342Power of Four
371Sum of Two Integers
389Find the Difference
393UTF-8 Validation
401Binary Watch
411Minimum Unique Word Abbreviation
461Hamming Distance
476Number Complement
477Total Hamming Distance
645Set Mismatch
693Binary Number with Alternating Bits
762Prime Number of Set Bits in Binary Representation
868Binary Gap
898Bitwise ORs of Subarrays
1178Number of Valid Words for Each Puzzle
1239Maximum Length of a Concatenated String with Unique Characters
1310XOR Queries of a Subarray
1318Minimum Flips to Make a OR b Equal to c
1342Number of Steps to Reduce a Number to Zero
1356Sort Integers by The Number of 1 Bits
1461Check If a String Contains All Binary Codes of Size K
1506Find Root of N-Ary Tree
1720Decode XORed Array
1734Decode XORed Permutation
1829Maximum XOR for Each Query
1999Smallest Greater Multiple Made of Two Digits
2135Count Words Obtained After Adding a Letter
2151Maximum Good People Based on Statements
2152Minimum Number of Lines to Cover Points
2157Groups of Strings
2174Remove All Ones With Row and Column Flips II
2212Maximum Points in an Archery Competition
2220Minimum Bit Flips to Convert Number
2247Maximum Cost of Trip With K Highways
2275Largest Combination With Bitwise AND Greater Than Zero
2317Maximum XOR After Operations
2354Number of Excellent Pairs
2397Maximum Rows Covered by Columns
2403Minimum Time to Kill All Monsters
2411Smallest Subarrays With Maximum Bitwise OR
2413Smallest Even Multiple
2419Longest Subarray With Maximum Bitwise AND
2425Bitwise XOR of All Pairings
2429Minimize XOR
2505Bitwise OR of All Subsequence Sums
2527Find Xor-Beauty of Array
2572Count the Number of Square-Free Subsets
2595Number of Even and Odd Bits
2729Check if The Number is Fascinating
2732Find a Good Subset of the Matrix
2802Find The K-th Lucky Number
2835Minimum Operations to Form Subsequence With Target Sum
2859Sum of Values at Indices With K Set Bits
2897Apply Operations on Array to Maximize Sum of Squares
2917Find the K-or of an Array
2930Number of Strings Which Can Be Rearranged to Contain Substring
2932Maximum Strong Pair XOR I
2935Maximum Strong Pair XOR II
2959Number of Possible Sets of Closing Branches
2965Find Missing and Repeated Values
2980Check if Bitwise OR Has Trailing Zeros
2992Number of Self-Divisible Permutations
2997Minimum Number of Operations to Make Array XOR Equal to K
3007Maximum Number That Sum of the Prices Is Less Than or Equal to K
3022Minimize OR of Remaining Elements Using Operations
3032Count Numbers With Unique Digits II
3064Guess the Number Using Bitwise Questions I
3094Guess the Number Using Bitwise Questions II
3125Maximum Number That Makes Result of Bitwise AND Zero
3133Minimum Array End
3141Maximum Hamming Distances
3145Find Products of Elements of Big Array
3199Count Triplets with Even XOR Set Bits I
3215Count Triplets with Even XOR Set Bits II
3226Number of Bit Changes to Make Two Integers Equal
3276Select Cells in Grid With Maximum Score
3283Maximum Number of Moves to Kill All Pawns
3287Find the Maximum Sequence Value of Array
3289The Two Sneaky Numbers of Digitville
3304Find the K-th Character in String Game I
3307Find the K-th Character in String Game II
3314Construct the Minimum Bitwise Array I
3315Construct the Minimum Bitwise Array II
3344Maximum Sized Array
3370Smallest Number With All Set Bits
3376Minimum Time to Break Locks I
3435Frequencies of Shortest Supersequences
3437Permutations III
3444Minimum Increments for Target Multiples in an Array
3513Number of Unique XOR Triplets I
3530Maximum Profit from Valid Topological Order in DAG
3533Concatenated Divisibility
3566Partition Array into Two Equal Product Subsets
3568Minimum Moves to Clean the Classroom
3575Maximum Good Subtree Score
3595Once Twice
3615Longest Palindromic Path in Graph
3630Partition Array for Maximum XOR and AND
3632Subarrays with XOR at Least K
3644Maximum K to Sort a Permutation
3646Next Special Palindrome Number
3670Maximum Product of Two Integers With No Common Bits
3677Count Binary Palindromic Numbers
3681Maximum XOR of Subsequences
3685Subsequence Sum After Capping Elements
3702Longest Subsequence With Non-Zero Bitwise XOR
3750Minimum Number of Flips to Reverse Binary String
3766Minimum Operations to Make Binary Palindrome
3769Sort Integers by Binary Reflection
3782Last Remaining Integer After Alternating Deletion Operations
3806Maximum Bitwise AND After Increment Operations
3812Minimum Edge Toggles on a Tree
3825Longest Strictly Increasing Subsequence With Non-Zero Bitwise AND
3827Count Monobit Integers
3845Maximum Subarray XOR with Bounded Range
3858Minimum Bitwise OR From Grid
3877Minimum Removals to Achieve Target XOR
3950Exactly One Consecutive Set Bits Pair
3954Sum of Compatible Numbers in Range I
3955Valid Binary Strings With Cost Limit
3989Maximum Consistent Columns in a Grid