Bit Manipulation | LeetCode Problems

99 Bit Manipulation solutions to LeetCode solutions.

Bit Manipulation Problems View all solutions →

Divide Two Integers

#29 Medium

Add Binary

#67 Easy

Subsets

#78 Medium

Gray Code

#89 Medium

Subsets II

#90 Medium

Single Number

#136 Easy

Single Number II

#137 Medium

Repeated DNA Sequences

#187 Medium

Reverse Bits

#190 Easy

Number of 1 Bits

#191 Easy

Bitwise AND of Numbers Range

#201 Medium

Count Complete Tree Nodes

#222 Easy

Power of Two

#231 Easy

Single Number III

#260 Medium

Missing Number

#268 Easy

Find the Duplicate Number

#287 Medium

Maximum Product of Word Lengths

#318 Medium

Counting Bits

#338 Easy

Power of Four

#342 Easy

Sum of Two Integers

#371 Medium

Find the Difference

#389 Easy

UTF-8 Validation

#393 Medium

Integer Replacement

#397 Medium

Binary Watch

#401 Easy

Convert a Number to Hexadecimal

#405 Easy

Maximum XOR of Two Numbers in an Array

#421 Medium

Hamming Distance

#461 Easy

Can I Win

#464 Medium

Matchsticks to Square

#473 Medium

Number Complement

#476 Easy

Total Hamming Distance

#477 Medium

Non-decreasing Subsequences

#491 Medium

Beautiful Arrangement

#526 Medium

Shopping Offers

#638 Medium

Set Mismatch

#645 Medium

Bulb Switcher II

#672 Medium

Stickers to Spell Word

#691 Hard

Binary Number with Alternating Bits

#693 Easy

Partition to K Equal Sum Subsets

#698 Medium

Pyramid Transition Matrix

#756 Medium

Prime Number of Set Bits in Binary Representation

#762 Easy

K-th Symbol in Grammar

#779 Medium

Transform to Chessboard

#782 Hard

Letter Case Permutation

#784 Medium

Split Array With Same Average

#805 Hard

Chalkboard XOR Game

#810 Hard

Flipping an Image

#832 Easy

Shortest Path Visiting All Nodes

#847 Hard

Score After Flipping Matrix

#861 Medium

Shortest Path to Get All Keys

#864 Hard

Binary Gap

#868 Easy

Bitwise ORs of Subarrays

#898 Medium

Find the Shortest Superstring

#943 Hard

Prison Cells After N Days

#957 Medium

Unique Paths III

#980 Hard

Triples with Bitwise AND Equal To Zero

#982 Hard

Minimum Number of K Consecutive Bit Flips

#995 Hard

Number of Squareful Arrays

#996 Hard

Complement of Base 10 Integer

#1009 Easy

Binary Prefix Divisible By 5

#1018 Easy

Smallest Sufficient Team

#1125 Hard

Can Make Palindrome from Substring

#1177 Medium

Number of Valid Words for Each Puzzle

#1178 Hard

Circular Permutation in Binary Representation

#1238 Medium

Maximum Length of a Concatenated String with Unique Characters

#1239 Medium

Maximum Score Words Formed by Letters

#1255 Hard

Minimum Number of Flips to Convert Binary Matrix to Zero Matrix

#1284 Hard

XOR Queries of a Subarray

#1310 Medium

Minimum Flips to Make a OR b Equal to c

#1318 Medium

Number of Steps to Reduce a Number to Zero

#1342 Easy

Maximum Students Taking Exam

#1349 Hard

Sort Integers by The Number of 1 Bits

#1356 Easy

Find the Longest Substring Containing Vowels in Even Counts

#1371 Medium

Cinema Seat Allocation

#1386 Medium

Number of Steps to Reduce a Number in Binary Representation to One

#1404 Medium

Number of Ways to Wear Different Hats to Each Other

#1434 Hard

Count Triplets That Can Form Two Arrays of Equal XOR

#1442 Medium

Pseudo-Palindromic Paths in a Binary Tree

#1457 Medium

Check If a String Contains All Binary Codes of Size K

#1461 Medium

XOR Operation in an Array

#1486 Easy

Parallel Courses II

#1494 Hard

Find a Value of a Mysterious Function Closest to Target

#1521 Hard

Number of Good Ways to Split a String

#1525 Medium

Find Longest Awesome Substring

#1542 Hard

Minimum Numbers of Function Calls to Make Target Array

#1558 Medium

Minimum Cost to Connect Two Groups of Points

#1595 Hard

Maximum Number of Achievable Transfer Requests

#1601 Hard

Minimum One Bit Operations to Make Integers Zero

#1611 Hard

Count Subtrees With Max Distance Between Cities

#1617 Hard

Sum of All Subset XOR Totals

#1863 Easy

Unique Length-3 Palindromic Subsequences

#1930 Medium

Divide Array Into Equal Pairs

#2206 Easy

Longest Nice Subarray

#2401 Medium

Bitwise XOR of All Pairings

#2425 Medium

Minimize XOR

#2429 Medium

Find the Prefix Common Array of Two Arrays

#2657 Medium

Neighboring Bitwise XOR

#2683 Medium

Minimum Cost Walk in Weighted Graph

#3108 Hard

Minimum Operations to Make Binary Array Elements Equal to One I

#3191 Medium