0% found this document useful (0 votes)
4 views4 pages

Updated Bitwise Operations Problems

The document outlines various famous bitwise operations problems categorized by the type of operation: AND, OR, XOR, NOT, Left Shift, Right Shift, NAND, NOR, and XNOR. Each category includes specific problems from platforms like LeetCode and GeeksforGeeks that illustrate the application of these operations. The problems range from checking powers of two to performing arithmetic operations using bitwise techniques.

Uploaded by

md2004sameer01
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views4 pages

Updated Bitwise Operations Problems

The document outlines various famous bitwise operations problems categorized by the type of operation: AND, OR, XOR, NOT, Left Shift, Right Shift, NAND, NOR, and XNOR. Each category includes specific problems from platforms like LeetCode and GeeksforGeeks that illustrate the application of these operations. The problems range from checking powers of two to performing arithmetic operations using bitwise techniques.

Uploaded by

md2004sameer01
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Famous Bitwise Operations Problems

1. AND (&) Operation:

1. LeetCode - Power of Two (Problem #231): Check if a number is a power of two.

2. LeetCode - Single Number (Problem #136): Find the number that appears only once in an

array.

3. GFG - Find Number of Set Bits: Count the number of set bits in a number.

4. LeetCode - Counting Bits (Problem #338): Return the number of 1's in binary representation for

all numbers from 0 to n.

5. LeetCode - Number of 1 Bits (Problem #191): Count the number of 1 bits in a number.

2. OR (|) Operation:

1. LeetCode - Maximum XOR of Two Numbers in an Array (Problem #421): Find the maximum

XOR of two numbers in an array.

2. GFG - Union of Two Arrays: Find the union of two arrays using bitwise OR.

3. LeetCode - Sum of Two Integers (Problem #371): Calculate the sum of two integers without

using `+` or `-`.

4. LeetCode - Subsets (Problem #78): Return all possible subsets of a set of integers.

5. LeetCode - Bitwise AND of Numbers Range (Problem #201): Find the bitwise AND of all

numbers in a given range.

3. XOR (^) Operation:

1. LeetCode - Single Number II (Problem #137): Find the number that appears only once in an

array.
2. LeetCode - Find the Duplicate Number (Problem #287): Find the duplicate number in an array.

3. LeetCode - Missing Number (Problem #268): Find the missing number in an array.

4. GFG - Find Two Non-Repeating Elements: Find the two non-repeating elements in an array

where every other element appears twice.

5. LeetCode - Maximum XOR of Two Numbers in an Array (Problem #421): Find the maximum

XOR of two numbers in an array.

4. NOT (~) Operation:

1. LeetCode - 2's Complement (Problem): Find the 2's complement of an integer.

2. LeetCode - Negative Number Check (Problem): Check if a number is negative using bitwise

operations.

3. GFG - Two's Complement Representation (Problem): Convert an integer to two's complement

form.

4. LeetCode - Bitwise NOT of Integer (Problem): Perform bitwise NOT on an integer and handle

sign extensions.

5. GFG - Integer Negation (Problem): Convert an integer to its negation using bitwise operations.

5. Left Shift (<<) Operation:

1. LeetCode - Multiply by 2 (Problem): Multiply a number by 2 using bitwise operations.

2. LeetCode - Divide by 2 (Problem): Divide a number by 2 using bitwise operations.

3. GFG - Fast Exponentiation (Problem): Use left shift for fast exponentiation (raising to a power).

4. LeetCode - Decimal to Binary (Problem): Convert a decimal number to binary.

5. GFG - Binary Search with Left Shift (Problem): Implement binary search using bitwise

operations and left shift.

6. Right Shift (>>) Operation:


1. LeetCode - Divide by 2 (Problem): Divide a number by 2 using bitwise operations.

2. LeetCode - Reverse Bits (Problem #190): Reverse the bits of a given 32-bit unsigned integer.

3. LeetCode - Subtract Product and Sum of Digits of an Integer (Problem #1281): Calculate the

difference between the product and sum of digits of a number.

4. GFG - Check for Power of 2: Check if a number is a power of 2 using bitwise operations.

5. GFG - Finding the Most Significant Set Bit: Find the position of the most significant set bit in a

number.

7. NAND Operation (NOT AND):

1. LeetCode - Find Complement (Problem #1009): Find the complement of a number.

2. LeetCode - Subset XOR Sum (Problem #1462): Return the sum of XOR of all subsets of a

number.

3. GFG - Generate Truth Table using NAND (Problem): Generate a truth table using NAND gates.

4. LeetCode - XOR Operation in an Array (Problem #1486): Perform XOR on the entire array.

5. LeetCode - Find Two Non-Overlapping Subarrays (Problem #1031): Find the maximum sum of

two non-overlapping subarrays.

8. NOR Operation (NOT OR):

1. LeetCode - Convert Integer to Base 7 (Problem #504): Convert an integer to base 7 using

bitwise operations.

2. LeetCode - Range Bitwise AND (Problem #201): Perform a range bitwise AND using NOR

operation.

3. GFG - Subset Sum Problem (Problem): Find the sum of all subsets of a given set using NOR.

4. LeetCode - Range XOR Query (Problem #1310): Perform range XOR queries using NOR

operation.

5. LeetCode - Maximum AND Sum of Array (Problem #1610): Find the maximum AND sum of a
given array using NOR.

9. XNOR Operation (NOT XOR):

1. LeetCode - Find XOR Sum of All Pairs (Problem): Find the XOR sum of all pairs in an array.

2. GFG - Count Set Bits in XNOR of Two Numbers: Count the set bits in XNOR of two numbers.

3. LeetCode - Largest Number At Least Twice of Others (Problem #747): Find the largest number

that's at least twice the others.

4. LeetCode - Unique Substrings in Wraparound String (Problem #467): Find unique substrings

using XNOR operation.

5. GFG - Largest Power of 2 Less than N: Find the largest power of 2 less than a given number.

You might also like