## Gray to Binary and Binary to Gray conversion

Binary Numbers is default way to store numbers, but in many applications binary numbers are difficult to use and a variation of binary numbers is… 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
- XOR of path between any two nodes in a Binary Tree
- 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
- Choose X such that (A xor X) + (B xor X) is minimized
- Print steps to make a number in form of 2^X - 1
- 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 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
- Find a number which give minimum sum when XOR with every number of array of integers
- Composite XOR and Coprime AND
- Create a sequence whose XOR of elements is y
- Minimizing array sum by applying XOR operation on all elements of the array
- Number of ways for playing first move optimally in a NIM game
- Total pairs in an array such that the bitwise AND, bitwise OR and bitwise XOR of LSB is 1

Binary Numbers is default way to store numbers, but in many applications binary numbers are difficult to use and a variation of binary numbers is… Read More »

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

Given an set of positive integers. find the maximum XOR subset value in the given set. Expected time complexity O(n). Examples: Input: set[] = {2,… Read More »

We have discussed different approaches to swap two integers without the temporary variable. How to swap in a single line without using library function? Python:… Read More »

The question is to find XOR of the XOR’s of all subsets. i.e if the set is {1,2,3}. All subsets are : [{1}, {2}, {3},… Read More »

Given an array of integers. find the maximum XOR subarray value in given array. Expected time complexity O(n). Examples: Input: arr[] = {1, 2, 3,… Read More »

Given two integers, find XOR of them without using XOR operator, i.e., without using ^ in C/C++. Examples : Input: x = 1, y =… Read More »

In C, following 6 operators are bitwise operators (work at bit-level) & (bitwise AND) Takes two numbers as operands and does AND on every bit… Read More »

Given two variables, x and y, swap two variables without using a third variable. Method 1 (Using Arithmetic Operators) The idea is to get sum… Read More »

Given two bit sequences as strings, write a function to return the addition of the two sequences. Bit strings can be of different lengths also.… Read More »

Given an array where every element occurs three times, except one element which occurs only once. Find the element that occurs once. Expected time complexity… Read More »

Given two signed integers, write a function that returns true if the signs of given integers are different, otherwise false. For example, the function should… Read More »

In the previous post, we discussed how a Doubly Linked can be created using only one space for address field with every node. In this… Read More »

Given an unsorted array that contains even number of occurrences for all numbers except two numbers. Find the two numbers which have odd occurrences in… Read More »

Given a number x and two positions (from right side) in binary representation of x, write a function that swaps n bits at given two… Read More »