# Tag Archives: Bitwise-AND

## Count of paths in given Binary Tree with odd bitwise AND for Q queries

Given an integer Q representing the number of queries and an array where each query has an integer N. Our task is to iterate through… Read More »

## Count of pairs whose bitwise AND is a power of 2

Given an array arr[] of N positive integers. The task is to find the number of pairs whose Bitwise AND value is a power of… Read More »

## Largest possible square submatrix with maximum AND value

Given an integer matrix mat [ ][ ] dimensions, the task is to find the largest possible square matrix from the given matrix with maximum… Read More »

## Construct the Array using given bitwise AND, OR and XOR

Given Bitwise AND, OR, and XOR of N elements of an array denoted by a, b, c. The task is to find the elements of… Read More »

## Maximum Bitwise AND pair (X, Y) from given range such that X and Y can be same

Given a range [L, R], the task is to find a pair (X, Y), not necessarily distinct. Find the maximum possible value of the bitwise… Read More »

## Minimum XOR of OR and AND of any pair in the Array

Given an array arr[] of N positive integers the task is to find the minimum value of Bitwise XOR of Bitwise OR and AND of… Read More »

## Count of pairs from Array with sum equal to twice their bitwise AND

Given an array arr[], the task is to count the pairs in the array with sum equal to twice their bitwise AND, i.e., Examples: Input:… Read More »

## Number of subsets with same AND, OR and XOR values in an Array

Given an array arr[] of size N consisting of non-negative integers, the task is to find the number of non-empty subsets of the array such… Read More »

## Bitwise AND of all the elements of array

Given an array, arr[] of N integers, the task is to find out the bitwise AND(&) of all the elements of the array. Examples: Input:… Read More »

## Find the remainder when N is divided by 4 using Bitwise AND operator

Given a number N, the task is to find the remainder when N is divided by 4 using Bitwise AND operator. Examples: Input: N =… Read More »

## Bitwise Operations on Digits of a Number

Given a number N, the task is to perform the bitwise operations on digits of the given number N. The bitwise operations include: Finding the… Read More »

## Maximum value of B less than A such that A ^ B = A + B

Given an integer A, the task is to find the maximum value possible(B) which is less than A, such that xor of these two numbers… Read More »

## Check if a Number is Odd or Even using Bitwise Operators

Given a number N, the task is to check whether the number is even or odd using Bitwise Operators. Examples: Input: N = 11 Output:… Read More »

## Bitwise AND of all even number up to N

Given an integer N, the task is to find bitwise and (&) of all even number from 1 to N. Examples: Input: 2 Output: 2… Read More »

## Queries to check whether bitwise AND of a subarray is even or odd

Given an array arr[] of N positive integers, the task is to answer Q queries where each query consists of a range [L, R] and… Read More »