## Count all pairs with given XOR

Given an array of distinct positive integers and a number x, find the number of pairs of integers in the array whose XOR is equal… 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
- XOR of XORs of all sub-matrices
- Count pairs with Bitwise XOR as EVEN number
- Check whether XOR of all numbers in a given range is even or odd
- Number of subarrays such that XOR of one half is equal to the other
- XOR of all the elements in the given range [L, R]
- Count of cyclic permutations having XOR with other binary string as 0
- Range Queries to Find number of sub-arrays with a given xor
- Count of values of x <= n for which (n XOR x) = (n - x)
- Count no. of ordered subsets having a particular XOR value
- Find array using different XORs of elements in groups of size 4
- Find a value whose XOR with given number is maximum
- Print steps to make a number in form of 2^X - 1
- Choose X such that (A xor X) + (B xor X) is minimized
- Find position of left most dis-similar bit for two numbers
- Count of sub-arrays whose elements can be re-arranged to form palindromes
- Check if a number from every row can be selected such that xor of the numbers is greater than zero
- All pairs whose xor gives unique prime
- Find a number which give minimum sum when XOR with every number of array of integers
- Create a sequence whose XOR of elements is y
- Find the node whose xor with x gives minimum value
- Generate all binary strings of length n with sub-string "01" appearing exactly twice
- Pairs from an array that satisfy the given condition
- Composite XOR and Coprime AND
- Minimizing array sum by applying XOR operation on all elements of the array
- Total pairs in an array such that the bitwise AND, bitwise OR and bitwise XOR of LSB is 1
- Number of ways for playing first move optimally in a NIM game
- XOR of all the nodes in the sub-tree of the given node

Given an array of distinct positive integers and a number x, find the number of pairs of integers in the array whose XOR is equal… Read More »

XOR Encryption is an encryption method used to encrypt data and is hard to crack by brute-force method, i.e generating random encryption keys to match… Read More »

Given a square matrix (N X N), the task is to find the maximum XOR value of a complete row or a complete column. Examples… Read More »

Given a number n, the task is to find the XOR from 1 to n. Examples : Input : n = 6 Output : 7… Read More »

Given a number n, the task is to check whether this number is a multiple of 4 or not without using +, -, * ,/… Read More »

Given a positive integer n, find count of positive integers i such that 0 <= i <= n and n+i = n^i Examples : Input… Read More »

Previous posts on this topic : Minimax Algorithm in Game Theory, Evaluation Function in Game Theory, Tic-Tac-Toe AI – Finding optimal move, Alpha-Beta Pruning. Zobrist… Read More »

Given three variables, a, b and c, swap them without temporary variable. Example : Input : a = 10, b = 20 and c =… Read More »

Given a binary array of size n where n > 3. A true (or 1) value in the array means active and false (or 0)… Read More »

Given an array of n unique integers where each element in the array is in range [1, n]. The array has all distinct elements and… Read More »

Inplace Operators in Python | Set 1(iadd(), isub(), iconcat()…) More functions are discussed in this articles. 1. ixor() :- This function is used to assign… Read More »

Given a function rand50() that returns 0 or 1 with equal probability, write a function that returns 1 with 75% probability and 0 with 25%… Read More »

Given an array that contains odd number of occurrences for all numbers except for a few elements which are present even number of times. Find… Read More »

Given two integers a and b, how can we evaluate the sum a + b without using operators such as +, -, ++, –, …?… Read More »

It is recommended to refer Interesting facts about Bitwise Operators as a prerequisite. 1. How to set a bit in the number ‘num’ : If… Read More »