## Range Queries to Find number of sub-arrays with a given xor

Given an array arr[] of size n and q queries and an integer k. Each query consists of an index range [l, r] and the… Read More »

- Sum of XOR of all subarrays
- Find elements of array using XOR of consecutive elements
- Convert Singly Linked List to XOR Linked List
- Count pairs with Bitwise XOR as EVEN number
- Check whether XOR of all numbers in a given range is even or odd
- XOR of XORs of all sub-matrices
- Number of subarrays such that XOR of one half is equal to the other
- XOR of path between any two nodes in a Binary Tree
- Maximum value of XOR among all triplets of an array
- Maximize the number of subarrays with XOR as zero
- Count of values of x <= n for which (n XOR x) = (n - x)
- XOR of all the elements in the given range [L, R]
- Count of cyclic permutations having XOR with other binary string as 0
- Replace every element of the array with BitWise XOR of all other
- Range Queries to Find number of sub-arrays with a given xor
- Count ordered pairs of positive numbers such that their sum is S and XOR is K
- Replace every array element by Bitwise Xor of previous and next element
- Find array using different XORs of elements in groups of size 4
- Count no. of ordered subsets having a particular XOR value
- Find a value whose XOR with given number is maximum
- Count numbers whose difference with N is equal to XOR with N
- Find position of left most dis-similar bit for two numbers
- Count of sub-arrays whose elements can be re-arranged to form palindromes
- Count numbers whose XOR with N is equal to OR with N
- All pairs whose xor gives unique prime
- XOR of all Prime numbers in an Array
- Count number of bits changed after adding 1 to given N
- Composite XOR and Coprime AND
- Pairs from an array that satisfy the given condition
- XOR of all elements of array with set bits equal to K

Given an array arr[] of size n and q queries and an integer k. Each query consists of an index range [l, r] and the… Read More »

Given an integer N, the task is to generate all possible binary strings of length N which contain “01” as the sub-string exactly twice. Examples:… Read More »

Two players A and B are playing NIM Game with each other. Both are playing optimally. Player A starts the game. The task is to… Read More »

Given a range [L, R], the task is to find the XOR of all the integers in the given range i.e. (L) ^ (L +… Read More »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »