## Count pairs in an array such that both elements has equal set bits

Given an array arr with unique elements, the task is to count the total number of pairs of elements that have equal set bits count.… Read More »

- Find XOR of all elements in an Array
- Count of subarrays of an Array having all unique digits
- Check if a Number is Odd or Even using Bitwise Operators
- Bitwise AND of all the elements of array
- Count number of binary strings without consecutive 1’s : Set 2
- Program to find the Nth natural number with exactly two bits set
- XOR of every element of an Array with a given number K
- Partition of a set into K subsets with equal sum using BitMask and DP
- XOR of elements in a given range with updates using Fenwick Tree
- Bitwise XOR of a Binary array
- Find a Mother vertex in a Graph using Bit Masking
- Count of pairs whose bitwise AND is a power of 2
- Count maximum occurrence of subsequence in string such that indices in subsequence is in A.P.
- Check if left and right shift of any string results into given string
- Count subarrays with sum equal to its XOR value
- Maximum number of set bits count in a K-size substring of a Binary String
- Number of subsets with same AND, OR and XOR values in an Array
- Largest number in the Array having frequency same as value
- Find the largest number smaller than integer N with maximum number of set bits
- Count of binary strings of length N having equal count of 0's and 1's
- Count of subarrays of size K with elements having even frequencies
- XOR of pairwise sum of every unordered pairs in an array
- Find a number such that maximum in array is minimum possible after XOR
- Sum of bit differences for numbers from 0 to N
- Remove all even parity nodes from a Doubly and Circular Singly Linked List
- Maximum weighted edge in path between two nodes in an N-ary tree using binary lifting
- Find the remainder when N is divided by 4 using Bitwise AND operator
- Find the length of the Largest subset such that all elements are Pairwise Coprime
- Bitwise operations on Subarrays of size K
- Number of integers in a range [L, R] which are divisible by exactly K of it's digits

Given an array arr with unique elements, the task is to count the total number of pairs of elements that have equal set bits count.… Read More »

Given an array of integers. The task is to replace every element by the bitwise xor of all other elements of the array. Examples: Input:… Read More »

Given a binary matrix. The task is to flip the matrix horizontally(find the image of the matrix), then invert it. Note: To flip a matrix… Read More »

Given a number N, the task is to check if xor value of the frequency of the digits is zero or not. Examples: Input: N… Read More »

Given two integers x and n, the task is to search for the first consecutive stream of 1s (in the x’s 32-bit binary representation) which… Read More »

Given an array of integers, replace every element with xor of previous and next elements with following exceptions. a) First element is replaced by sum… Read More »

Given an array of n elements. The task is to print the maximum sum by selecting two subsequences of the array (not necessarily different) such… Read More »

Given an array of integers and a number . The task is to sort only those elements of the array whose total set bits are… Read More »

Suppose a variable x can have only two possible values a and b, and you wish to assign to x the value other than its… Read More »

Given an integer n, output the no. of leading zeros in it’s binary form. A leading zero is any 0 digit that comes before the… Read More »

Given an unsigned integer x. Round it up to the next greater multiple of 8 using bitwise operations only. Examples: Input : 35 Output :… Read More »

Given an unsigned integer x. Round it down to the next smaller multiple of 8 using bitwise operations only. Examples: Input : 35 Output :… Read More »

We have an integer N. We need to express N as a sum of K integers such that by adding some(or all) of these integers… Read More »

Given two Integer numbers x and y. Compare and print which one of them has more leading zeros using Bitwise operation. If both the no.… Read More »

Given an array arr[] containing N numbers. The task is to check whether the bitwise-OR of the given N numbers is even or odd. Examples:… Read More »