## Count of sub-arrays whose elements can be re-arranged to form palindromes

Given an array arr[] of size n. The task is to count the number of possible sub-arrays such that their elements can be re-arranged to… Read More »

## XOR of XORs of all sub-matrices

Given a ‘N*N’ matrix, the task is to find the XOR of XORs of all possible sub-matrices. Examples: Input :arr = {{3, 1}, {1, 3}}… Read More »

## Number of subarrays such that XOR of one half is equal to the other

Given an array of N numbers, the task is to find the number of sub-arrays (size of the sub-array should be an even number) of… Read More »

## Sum of XOR of all subarrays

Given an array containing N positive integers, the task is to find the sum of XOR of all sub-arrays of the array. Examples: Input :… Read More »

## Check whether XOR of all numbers in a given range is even or odd

Given a range [ L, R ], the task is to find if value of XOR of all natural numbers in range L to R… 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 »

## Find array using different XORs of elements in groups of size 4

Given an array q[] of XOR queries of size N (N is a multiple of 4) which describe an array of the same size as… Read More »

Prerequisite: XOR Linked List – A Memory Efficient Doubly Linked List | Set 1 XOR Linked List – A Memory Efficient Doubly Linked List |… Read More »

## Count of values of x <= n for which (n XOR x) = (n – x)

Given an integer n, the task is to find the number of possible values of 0 ≤ x ≤ n which satisfy n XOR x… Read More »

## Count no. of ordered subsets having a particular XOR value

Given an array arr[] of n elements and a number K, find the number of ordered subsets of arr[] having XOR of elements as K… Read More »

## Pairs from an array that satisfy the given condition

Given an array arr[], the task is to count all the valid pairs from the array. A pair (arr[i], arr[j]) is said to be valid… Read More »

## Find elements of array using XOR of consecutive elements

Given an array arr[] in which XOR of every 2 consecutive elements of the original array is given i.e if the total number of elements… Read More »

## All pairs whose xor gives unique prime

Given an array arr[], the task is to count all the pairs whose xor gives the unique prime, i.e. no two pairs should give the… Read More »

## Find position of left most dis-similar bit for two numbers

Given two numbers n1 and n2. The task is to find the position of first mismatching bit in the binary representation of the two numbers… Read More »

## Count pairs with Bitwise XOR as EVEN 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 even. Examples:… Read More »