# Tag Archives: Bitwise-XOR

We are given an array of n elements. The task is to make XOR of whole array 0. We can do the following to achieve… Read More
Given a number, toggle all bits of it after most significant bit including most significant bit. Examples :  Input : 10 Output : 5 Binary… Read More
Given two non-negative numbers m and n. Find the position of rightmost same bit in the binary representation of the numbers. Examples:   Input : m… Read More
Given an array containing n numbers. The problem is to split the array into two subarrays such that the absolute difference of the xor values… Read More
Consider a binary array consisting of N elements (initially all elements are 0). After that, you are given M commands where each command is of… Read More
Given an array of n numbers and a number k. You have to write a program to find the number of subarrays with xor less… Read More
Given an array of N positive integers. There are Q queries, each include a range [L, R]. For each query output the xor of greatest… Read More
Given a binary string, task is to erase exactly one integer in the array so that the XOR of the remaining numbers is zero. The… Read More
Given an array of n integers. Find out number of pairs in array whose XOR is odd. Examples :  Input : arr[] = { 1,… Read More
You are given a number of queries Q and each query will be of the following types: Query 1 : add(x) This means add x… Read More
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
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
Given a integer ‘x’, find the number of values of ‘a’ satisfying the following conditions:  0 <= a <= x a XOR x = a… Read More
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
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