Tutorials
Courses
Data Structure
Java
Python
HTML
Interview Preparation
DSA
Practice Problems
C
C++
Java
Python
JavaScript
Data Science
Machine Learning
Courses
Linux
DevOps
SQL
Web Development
System Design
Aptitude
GfG Premium
Similar Topics
Web Technologies
37.4K+ articles
DSA
22.8K+ articles
Mathematical
7.7K+ articles
Arrays
6.4K+ articles
Competitive Programming
3.2K+ articles
Greedy
2.1K+ articles
Algorithms
2.0K+ articles
Bit Magic
1.2K+ articles
Bitwise-XOR
443+ articles
Bitwise-OR
122+ articles
Bitwise-AND
149+ posts
Recent Articles
Popular Articles
Find last element in Array formed from bitwise AND of array elements
Last Updated: 29 September 2022
Given an array A[] of size N, the task is to find the last remaining element in a new array B containing all pairwise bitwise AND of elements from A i.e., B consists of N?...
read more
Bit Magic
Competitive Programming
DSA
Arrays
Bitwise-OR
Bitwise-AND
Maximize bitwise AND of Array by changing at most K bits of elements
Last Updated: 01 November 2022
Given an array arr[] of length N. You can perform at most K operations on the array of the following type:Choose an index i (0 ? i ? N-1) and set the j-th bit of arr[i] to...
read more
Bit Magic
Greedy
DSA
Arrays
setBitCount
Bitwise-AND
Introduction to Bitwise Algorithms - Data Structures and Algorithms Tutorial
Last Updated: 27 November 2024
Bit stands for binary digit. A bit is the basic unit of information and can only have one of two possible values that is 0 or 1. In our world, we usually with numbers usin...
read more
Bit Magic
Algorithms
DSA
setBitCount
Bitwise-XOR
CPP-bitset
Bit Algorithms
Bitwise-OR
Bitwise-AND
Tutorials
DSA-Blogs
DSA Tutorials
Find the original matrix from the given AND matrix
Last Updated: 28 February 2023
Given a binary matrix B[][] of size N*M, the task is to find a matrix A[][] of the same size such that B[i][j] is the bitwise AND of all the elements in ith row and jth co...
read more
Matrix
Technical Scripter
Technical Scripter 2022
DSA
Bitwise-AND
Split Array into maximum Subsets with same bitwise AND
Last Updated: 29 November 2022
Given an array arr[] of size N, the task is to find the maximum number of subsets the array can be split such that the bitwise AND of the subsets is the same.Examples:Inpu...
read more
Misc
Recursion
DSA
Arrays
subset
Bitwise-AND
Find pair whose bitwise OR and bitwise AND follows the given condition
Last Updated: 28 April 2025
Given 2 arrays arr1[] and arr2[], of size N and M respectively, the task is to find a pair of value (say a and b) such that the following conditions are satisfied:(a | b) ...
read more
Bit Magic
Technical Scripter
Technical Scripter 2022
DSA
Arrays
Bitwise-OR
Bitwise-AND
Count permutations whose prefix & suffix AND are same for each index
Last Updated: 07 February 2023
Given an array arr[] of size N, Return the number of permutations of array arr[] which satisfy the condition arr[1] arr[2] . . . arr[i] = arr[i+1] arr[i+2] . . . arr...
read more
Bit Magic
Sorting
DSA
Arrays
prefix
Bitwise-AND
Print the Longest Subarray whose Bitwise AND is maximum
Last Updated: 14 September 2023
Given a positive integer array arr[] of size N, the task is to print the longest non-empty subarray whose bitwise AND is maximum in the array.Examples:Input: arr[ ] = {1, ...
read more
Bit Magic
DSA
Arrays
subarray
Data Structures
Bitwise-AND
Bitwise AND and XOR pair counting
Last Updated: 16 September 2023
Given an integer array arr[] of size N, the task is to count the number of pairs whose BITWISE AND and BITWISE XOR are equal.Examples:Input: N = 3, arr[] = [0, 0, 1]Output...
read more
Bit Magic
DSA
Arrays
Bitwise-XOR
Bitwise-AND
Minimum Bitwise AND operations to make two numbers equal
Last Updated: 31 July 2023
Given two numbers a and b, the task is to find the minimum number of operations required to make a and b equal. In each operation, we can pick a non-negative integer x and...
read more
Bit Magic
DSA
Data Structures
Bitwise-AND
Check if there exists a subsequence such that its cumulative AND is equal to X
Last Updated: 11 November 2023
Given an array A[] of length N along with an integer X. Then the task is to output the subsequence such that the cumulative AND of all elements that are present in the sub...
read more
Greedy
Geeks Premier League
DSA
Arrays
subsequence
Java-ArrayList
Bitwise-AND
Geeks Premier League 2023
Count valid Bitwise operation combinations for Binary Strings
Last Updated: 07 November 2023
Given an odd integer N (N = 3), a binary string S of length N and another string O of length (N-1)/2. Here, each character in string O can be one of the following: '', '|'...
read more
Bit Magic
Competitive Programming
DSA
Bitwise-XOR
Bitwise-OR
Bitwise-AND
Maths
Count Number of Pairs where Bitwise AND and Bitwise XOR is Equal
Last Updated: 12 January 2024
Given an integer array arr of size N, the task is to count the number of pairs whose BITWISE AND and BITWISE XOR are equal.Example:Input: N = 3, arr[] = {0,0,1}Output: 1Ex...
read more
Bit Magic
DSA
Bitwise-XOR
Data Structures
Bitwise-AND
Geeks Premier League 2023
Complete Reference for Bitwise Operators in Programming/Coding
Last Updated: 28 December 2023
There exists no programming language that doesn't use Bit Manipulations. Bit manipulation is all about these bitwise operations. They improve the efficiency of programs by...
read more
Bit Magic
DSA
Bitwise-XOR
Bitwise-OR
Bitwise-AND
Programming
Bitwise Operators
Check if an Array exists with Bitwise OR as A and Bitwise AND as B
Last Updated: 09 January 2024
Three integers N, A and B are given to you. you need to create an array arr of length 'N' such that it satisfies the following conditions :Each elements of arr should be u...
read more
DSA
Arrays
Bitwise-OR
Bitwise-AND
1
2
3
4
...
10
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our
Cookie Policy
&
Privacy Policy
Got It !