## Find a number X such that (X XOR A) is minimum and the count of set bits in X and B are equal

Given two integers A and B, the task is to find an integer X such that (X XOR A) is minimum possible and the count… Read More »

## Find extra element in the second array

Given two arrays A[] and B[]. The second array B[] contains all the elements of A[] except for 1 extra element. The task is to… Read More »

## Length of the longest subsequence such that xor of adjacent elements is non-decreasing

Given a sequence arr of N positive integers, the task is to find the length of the longest subsequence such that xor of adjacent integers… Read More »

## Number of ways to erase exactly one element in the Binary Array to make XOR zero

Given a binary array of 0’s and 1’s, the task is to find the number of ways to erase exactly one element from this array… Read More »

## Maximize the Expression | Bit Manipulation

Given two positive integers A and B. Let’s define D such that B AND D = D. The task is to maximize the expression A… Read More »

## Bitwise XOR of elements having odd frequency

Given an array arr[] of N elements, the task is to find the XOR of the elements which appear odd number of times in the… Read More »

## XOR of K smallest prime and composite numbers from the given array

Given an array arr[] of N non-zero positive integers and an integer K, the task is to find the XOR of the K largest prime… Read More »

## XOR of K largest prime and composite numbers from the given array

Given an array arr[] of N non-zero positive integers and an integer K, the task is to find the XOR of the K largest prime… Read More »

## Count of elements which are equal to the XOR of the next two elements

Given an array arr[] of n elements. The task is to find the count of elements which are equal to the XOR of the next… Read More »

## Absolute difference between the XOR of Non-Prime numbers and Prime numbers of an Array

Given an array arr[] of N positive integers, the task is to calculate the absolute difference between XOR of non-prime numbers and prime numbers. Note… Read More »

## Queries to check whether all the elements in the given range occurs even number of times

Given an array arr[] containing N integers and there are Q queries where each query consists of a range [L, R]. The task is to… Read More »

## XOR of elements in an array having prime frequency

Given an array arr[] of N elements, the task is to find the xor of the elements which have prime frequencies in the array. Note… Read More »

## Find number of subarrays with XOR value a power of 2

Given an integer array, arr[] of size N. The XOR value of any subarray of arr[] is defined as the xor of all the integers… Read More »

## Check if the array has an element which is equal to XOR of remaining elements

Given an array arr[] of N elements, the task is to check if the array has an element which is equal to the XOR of… Read More »

## Find the XOR of first N Prime Numbers

Given a positive integer N, the task is to find the XOR of the first N prime numbers. Examples: Input: N = 3 Output: 4… Read More »