##
Segment Tree | Set 3 (XOR of given range)
June 14, 2017

We have an array arr[0 . . . n-1]. There are two type of queries Find the XOR of elements from index l to r… Read More »

June 14, 2017

We have an array arr[0 . . . n-1]. There are two type of queries Find the XOR of elements from index l to r… Read More »

June 7, 2017

Given an array of integers, we need to get total XOR of all subarray XORs where subarray XOR can be obtained by XORing all elements… Read More »

May 15, 2017

Given a integer ‘x’, find the number of values of ‘a’ satisfying the following conditions: 0 <= a <= x a XOR x = a… Read More »

May 10, 2017

Given a range [L, R], we need to find two integers in this range such that their XOR is maximum among all possible choices of… Read More »

May 9, 2017

Given an array ‘arr1’ of n positive integers. Contents of arr1[] are copied to another array ‘arr2’, but numbers are shuffled and one element is… Read More »

May 3, 2017

We are given a string. We are also given indexes of first and last characters in string. The task is to reverse the string without… Read More »

April 20, 2017

Given an array of integers arr[] and a number m, count the number of subarrays having XOR of their elements as m. Examples: Input :… Read More »

March 30, 2017

March 26, 2017

Given a integer ‘x’, find the number of values of ‘a’ satisfying the following conditions: a XOR x > x 0 < a < x… Read More »

March 22, 2017

Given an array of integers. All numbers occur twice except one number which occurs once. Find the number in O(n) time & constant extra space.… Read More »

March 21, 2017

Given an array A[] having n positive elements. The task to create another array B[] such as B[i] is XOR of all elements of array… Read More »

March 12, 2017

Given an array of size n and integer k, count all pairs in array which differ in exactly K bits of binary representation of both… Read More »

March 4, 2017

Given four arrays and an integer x, find the number of quadruples which satisfy a^b^c^d = x, where a belongs from Arr1, b belongs from… Read More »

March 2, 2017

Given an array arr[] of size n, we need to find sum of all the values that comes from XORing all the elements of the… Read More »

February 22, 2017

Given a sequence of three binary sequences A, B and C of N bits. Count the minimum bits required to flip in A and B… Read More »