# Tag Archives: Bitwise-XOR (adsbygoogle = window.adsbygoogle || []).push({});

## Count ordered pairs of positive numbers such that their sum is S and XOR is K

Given a sum and a number . The task is to count all possible ordered pairs (a, b) of positive numbers such that the two… Read More »

## Number of solutions of n = x + n ⊕ x

Given a number n, we have to find the number of possible values of X such that n = x + n ⊕ x. Here… Read More »

## Check if elements of Linked List are present in pair

Given a singly linked list of integers. The task is to check if each element in the linked list is present in a pair i.e.… Read More »

## Count all pairs of adjacent nodes whose XOR is an odd number

Given a Binary Tree as shown below. The task is to count all pair of adjacent nodes whose XOR is an odd number. Explanation: Initially,… Read More »

## Hamming distance between two Integers

Given two integers, the task is to find the hamming distance between two integers. Hamming Distance between two integers is the number of bits which… Read More »

## 2’s compliment for a givin string using XOR

Given a binary string, task is to convert this string in to two’s compliment with the help of XOR operator. Examples: Input : 00000101 Output… Read More »

## Minimum number of elements to be removed to make XOR maximum

Given a number where, . The task is to find the minimum number of elements to be deleted in between to such that the XOR… Read More »

## Minimum value of N such that xor from 1 to N is equal to K

Given a value K which is the XOR of all the values from 1 to N, the task is to find the minimum value of… Read More »

## Program to invert bits of a number Efficiently

Given a non-negative integer N. The task is to invert the bits of the number N and print the decimal equivalent of the number obtained… Read More »

## Value in a given range with maximum XOR

Given positive integers N, L, and R, we have to find the maximum value of N ⊕ X, where X ∈ [L, R]. Examples: Input… Read More »

## Number of ways to change the XOR of two numbers by swapping the bits

Given two binary strings s1 and s2. The XOR of them is X, the task is to find the number of ways to swap two-bit… Read More »

## Count pairs with Bitwise XOR as ODD number

Given an array of N integers, the task is to find the number of pairs (i, j) such that A[i] ^ A[j] is odd. Examples:… Read More »

## Sum of XOR of sum of all pairs in an array

Given an array, find the XOR of sum of all pairs in an array. Examples: Input : arr[] = {1, 2, 3} Output : 0… Read More »

## Check if bits in range L to R of two numbers are complement of each other or not

Given two non-negative numbers a and b and two values l and r. The problem is to check whether all bits at corresponding positions in… Read More »

## Check whether all the bits are unset in the given range

Given a non-negative number n and two values l and r. The problem is to check whether all the bits are unset or not in… Read More »