# Tag Archives: Bitwise-AND (adsbygoogle = window.adsbygoogle || []).push({});

## Maximum Bitwise AND pair from given range

Given a range [L, R], the task is to find a pair (X, Y) such that L ≤ X < Y ≤ R and X… Read More »

## Sum of bitwise AND of all subarrays

Given an array consisting of N positive integers, find the sum of bit-wise and of all possible sub-arrays of the array. Examples: Input : arr[]… Read More »

## Modify a binary array to Bitwise AND of all elements as 1

Given an array a[] consisting only 0 and 1. The task is to check if it is possible to transform the array such that the… Read More »

## Composite XOR and Coprime AND

Given an array arr[], the task is to count the number of unordered pairs of indices (i, j) such the gcd(2, a[i]^a[j]) > 1 and… Read More »

## Count pairs with Bitwise-AND as even number

Given an array of integers. The task is to find the number of pairs (i, j) such that A[i] & A[j] is even. Examples: Input:… Read More »

## Find subsequences with maximum Bitwise AND and Bitwise OR

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 »

## Round to next greater multiple of 8

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 »

## Comparing leading zeros in binary representations of two numbers

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 »

## Numbers that are bitwise AND of at least one non-empty sub-array

Given an array ‘arr’, the task is to find all possible integers each of which is the bitwise AND of at least one non-empty sub-array… Read More »

## Minimum Bitwise AND operations to make any two array elements equal

Given an array of integers of size ‘n’ and an integer ‘k’, We can perform the Bitwise AND operation between any array element and ‘k’… Read More »

## Check whether product of ‘n’ numbers is even or odd

Given an array arr[] containing n numbers. The problem is to check whether the product of the given n numbers is even or odd. Examples:… Read More »

## Check whether bitwise AND of a number with any subset of an array is zero or not

Given an array and a Number N. The task is to check whether there exists any subset of this array such that the bitwise AND… Read More »

## Find triplets in an array whose AND is maximum

Given an array of positive integers of size n. Find the count of the triplets whose AND is maximum and also find that maximum given… Read More »

## Find bitwise AND (&) of all possible sub-arrays

Given an array A of size N where, . The task is to find the AND of all possible sub-arrays of A and then the… Read More »

## Count pairs with Bitwise AND as ODD number

Given an array of N integers. The task is to find the number of pairs (i, j) such that A[i] & A[j] is odd. Examples:… Read More »