← back

Bit Manipulation

248 questions · 0 seen

All Bit Manipulation problems

Problems

29 Divide Two Integers
67 Add Binary
78 Subsets
89 Gray Code
90 Subsets II
136 Single Number
137 Single Number II
187 Repeated DNA Sequences
190 Reverse Bits
191 Number of 1 Bits
201 Bitwise AND of Numbers Range
222 Count Complete Tree Nodes
231 Power of Two
260 Single Number III
268 Missing Number
287 Find the Duplicate Number
318 Maximum Product of Word Lengths
338 Counting Bits
342 Power of Four
371 Sum of Two Integers
389 Find the Difference
393 UTF-8 Validation
397 Integer Replacement
401 Binary Watch
405 Convert a Number to Hexadecimal
421 Maximum XOR of Two Numbers in an Array
461 Hamming Distance
464 Can I Win
473 Matchsticks to Square
476 Number Complement
477 Total Hamming Distance
491 Non-decreasing Subsequences
526 Beautiful Arrangement
638 Shopping Offers
645 Set Mismatch
672 Bulb Switcher II
691 Stickers to Spell Word
693 Binary Number with Alternating Bits
698 Partition to K Equal Sum Subsets
756 Pyramid Transition Matrix
762 Prime Number of Set Bits in Binary Representation
779 K-th Symbol in Grammar
782 Transform to Chessboard
784 Letter Case Permutation
805 Split Array With Same Average
810 Chalkboard XOR Game
832 Flipping an Image
847 Shortest Path Visiting All Nodes
861 Score After Flipping Matrix
864 Shortest Path to Get All Keys
868 Binary Gap
898 Bitwise ORs of Subarrays
943 Find the Shortest Superstring
957 Prison Cells After N Days
980 Unique Paths III
982 Triples with Bitwise AND Equal To Zero
995 Minimum Number of K Consecutive Bit Flips
996 Number of Squareful Arrays
1009 Complement of Base 10 Integer
1016 Binary String With Substrings Representing 1 To N
1018 Binary Prefix Divisible By 5
1125 Smallest Sufficient Team
1177 Can Make Palindrome from Substring
1178 Number of Valid Words for Each Puzzle
1238 Circular Permutation in Binary Representation
1239 Maximum Length of a Concatenated String with Unique Characters
1255 Maximum Score Words Formed by Letters
1284 Minimum Number of Flips to Convert Binary Matrix to Zero Matrix
1310 XOR Queries of a Subarray
1318 Minimum Flips to Make a OR b Equal to c
1342 Number of Steps to Reduce a Number to Zero
1349 Maximum Students Taking Exam
1356 Sort Integers by The Number of 1 Bits
1371 Find the Longest Substring Containing Vowels in Even Counts
1386 Cinema Seat Allocation
1404 Number of Steps to Reduce a Number in Binary Representation to One
1434 Number of Ways to Wear Different Hats to Each Other
1442 Count Triplets That Can Form Two Arrays of Equal XOR
1457 Pseudo-Palindromic Paths in a Binary Tree
1461 Check If a String Contains All Binary Codes of Size K
1483 Kth Ancestor of a Tree Node
1486 XOR Operation in an Array
1494 Parallel Courses II
1521 Find a Value of a Mysterious Function Closest to Target
1525 Number of Good Ways to Split a String
1542 Find Longest Awesome Substring
1558 Minimum Numbers of Function Calls to Make Target Array
1595 Minimum Cost to Connect Two Groups of Points
1601 Maximum Number of Achievable Transfer Requests
1611 Minimum One Bit Operations to Make Integers Zero
1617 Count Subtrees With Max Distance Between Cities
1655 Distribute Repeating Integers
1659 Maximize Grid Happiness
1680 Concatenation of Consecutive Binary Numbers
1681 Minimum Incompatibility
1684 Count the Number of Consistent Strings (PRO)
1707 Maximum XOR With an Element From Array (PRO)
1720 Decode XORed Array
1723 Find Minimum Time to Finish All Jobs
1734 Decode XORed Permutation
1738 Find Kth Largest XOR Coordinate Value (PRO)
1755 Closest Subsequence Sum
1763 Longest Nice Substring (PRO)
1787 Make the XOR of All Segments Equal to Zero
1799 Maximize Score After N Operations
1803 Count Pairs With XOR in a Range (PRO)
1815 Maximum Number of Groups Getting Fresh Donuts
1829 Maximum XOR for Each Query
1835 Find XOR Sum of All Pairs Bitwise AND
1863 Sum of All Subset XOR Totals
1879 Minimum XOR Sum of Two Arrays
1915 Number of Wonderful Substrings
1930 Unique Length-3 Palindromic Subsequences (PRO)
1938 Maximum Genetic Difference Query (PRO)
1947 Maximum Compatibility Score Sum
1986 Minimum Number of Work Sessions to Finish the Tasks
1994 The Number of Good Subsets
2002 Maximum Product of the Length of Two Palindromic Subsequences
2032 Two Out of Three
2035 Partition Array Into Two Arrays to Minimize Sum Difference
2044 Count Number of Maximum Bitwise-OR Subsets
2135 Count Words Obtained After Adding a Letter
2151 Maximum Good People Based on Statements
2157 Groups of Strings (PRO)
2172 Maximum AND Sum of Array
2206 Divide Array Into Equal Pairs
2212 Maximum Points in an Archery Competition
2220 Minimum Bit Flips to Convert Number
2275 Largest Combination With Bitwise AND Greater Than Zero
2305 Fair Distribution of Cookies
2306 Naming a Company
2317 Maximum XOR After Operations
2322 Minimum Score After Removals on a Tree
2351 First Letter to Appear Twice
2354 Number of Excellent Pairs
2397 Maximum Rows Covered by Columns
2401 Longest Nice Subarray
2411 Smallest Subarrays With Maximum Bitwise OR
2419 Longest Subarray With Maximum Bitwise AND
2425 Bitwise XOR of All Pairings
2429 Minimize XOR
2433 Find The Original Array of Prefix Xor
2438 Range Product Queries of Powers
2506 Count Pairs Of Similar Strings
2527 Find Xor-Beauty of Array
2546 Apply Bitwise Operations to Make Strings Equal
2564 Substring XOR Queries (PRO)
2568 Minimum Impossible OR
2571 Minimum Operations to Reduce an Integer to 0
2572 Count the Number of Square-Free Subsets
2588 Count the Number of Beautiful Subarrays
2595 Number of Even and Odd Bits
2657 Find the Prefix Common Array of Two Arrays
2680 Maximum OR
2683 Neighboring Bitwise XOR
2708 Maximum Strength of a Group
2732 Find a Good Subset of the Matrix
2741 Special Permutations
2749 Minimum Operations to Make the Integer Zero
2791 Count Paths That Can Form a Palindrome in a Tree
2835 Minimum Operations to Form Subsequence With Target Sum
2836 Maximize Value of Function in a Ball Passing Game
2850 Minimum Moves to Spread Stones Over Grid
2857 Count Pairs of Points With Distance k
2859 Sum of Values at Indices With K Set Bits
2869 Minimum Operations to Collect Elements
2871 Split Array Into Maximum Number of Subarrays
2897 Apply Operations on Array to Maximize Sum of Squares
2917 Find the K-or of an Array
2920 Maximum Points After Collecting Coins From All Nodes
2932 Maximum Strong Pair XOR I
2935 Maximum Strong Pair XOR II
2939 Maximum Xor Product
2959 Number of Possible Sets of Closing Branches
2980 Check if Bitwise OR Has Trailing Zeros
2997 Minimum Number of Operations to Make Array XOR Equal to K
3003 Maximize the Number of Partitions After Operations
3007 Maximum Number That Sum of the Prices Is Less Than or Equal to K
3011 Find if Array Can Be Sorted
3022 Minimize OR of Remaining Elements Using Operations
3068 Find the Maximum Sum of Node Values
3095 Shortest Subarray With OR at Least K I
3097 Shortest Subarray With OR at Least K II
3108 Minimum Cost Walk in Weighted Graph
3116 Kth Smallest Amount With Single Denomination Combination
3117 Minimum Sum of Values by Dividing Array
3133 Minimum Array End
3145 Find Products of Elements of Big Array
3149 Find the Minimum Cost Array Permutation
3154 Find Number of Ways to Reach the K-th Stair
3158 Find the XOR of Numbers Which Appear Twice
3171 Find Subarray With Bitwise OR Closest to K
3181 Maximum Total Reward Using Operations II
3191 Minimum Operations to Make Binary Array Elements Equal to One I
3209 Number of Subarrays With AND Value of K
3211 Generate Binary Strings Without Adjacent Zeros (PRO)
3226 Number of Bit Changes to Make Two Integers Equal
3276 Select Cells in Grid With Maximum Score
3283 Maximum Number of Moves to Kill All Pawns
3287 Find the Maximum Sequence Value of Array
3304 Find the K-th Character in String Game I
3307 Find the K-th Character in String Game II
3309 Maximum Possible Number by Binary Concatenation
3314 Construct the Minimum Bitwise Array I
3315 Construct the Minimum Bitwise Array II
3370 Smallest Number With All Set Bits
3376 Minimum Time to Break Locks I
3393 Count Paths With the Given XOR Value
3435 Frequencies of Shortest Supersequences
3444 Minimum Increments for Target Multiples in an Array
3495 Minimum Operations to Make Array Elements Zero
3513 Number of Unique XOR Triplets I
3514 Number of Unique XOR Triplets II
3530 Maximum Profit from Valid Topological Order in DAG
3533 Concatenated Divisibility
3534 Path Existence Queries in a Graph II
3539 Find Sum of Array Product of Magical Sequences
3553 Minimum Weighted Subgraph With the Required Paths II
3559 Number of Ways to Assign Edge Weights II
3566 Partition Array into Two Equal Product Subsets
3568 Minimum Moves to Clean the Classroom
3575 Maximum Good Subtree Score
3585 Find Weighted Median Node in Tree
3594 Minimum Time to Transport All Individuals
3599 Partition Array to Minimize XOR
3615 Longest Palindromic Path in Graph
3621 Number of Integers With Popcount-Depth Equal to K I
3630 Partition Array for Maximum XOR and AND
3644 Maximum K to Sort a Permutation
3646 Next Special Palindrome Number
3670 Maximum Product of Two Integers With No Common Bits
3674 Minimum Operations to Equalize Array
3677 Count Binary Palindromic Numbers
3681 Maximum XOR of Subsequences
3688 Bitwise OR of Even Numbers in an Array
3702 Longest Subsequence With Non-Zero Bitwise XOR
3750 Minimum Number of Flips to Reverse Binary String
3755 Find Maximum Balanced XOR Subarray Length
3757 Number of Effective Subsequences
3766 Minimum Operations to Make Binary Palindrome
3801 Minimum Cost to Merge Sorted Lists
3806 Maximum Bitwise AND After Increment Operations
3811 Number of Alternating XOR Partitions
3821 Find Nth Smallest Integer With K One Bits
3825 Longest Strictly Increasing Subsequence With Non-Zero Bitwise AND
3827 Count Monobit Integers
3845 Maximum Subarray XOR with Bounded Range
3849 Maximum Bitwise XOR After Rearrangement