Given an array arr[] consisting of N positive integers, the task is to find the sum of all array elements having a distinct count of… Read More

# Category Archives: Bit Magic

Given an array A[] of size N, the task is to count the number of subsequences from the given array whose Bitwise XOR value is… Read More

Given an XOR linked list, the task is to delete the node at the end of the XOR Linked List. Examples: Input: 4<–>7<–>9<–>7Output: 4<–>7<–>9Explanation: Deleting… Read More

Given an array arr[] consisting of N integers, the task is to find the sum of Bitwise AND of (arr[i] + arr[j]) and Bitwise AND… Read More

Given a Binary Tree consisting of nodes with values 0 and 1 only, the task is to find the total sum of the decimal equivalents… Read More

Given an array arr[] of size N, the task is to replace a pair of array elements whose Bitwise XOR is even by their Bitwise… Read More

Given an array arr[] consisting of N positive integers, replace pairs of array elements whose Bitwise AND exceeds Bitwise XOR values by their Bitwise AND… Read More

Given an array arr[] consisting of N positive integers, the task is to find the maximum absolute difference between the sum of the array elements… Read More

Given a square matrix mat[][] of dimension N*N, convert the elements present in both the diagonals to their respective binary representations and perform the following… Read More

Given a Binary Tree consisting of N nodes, the task is to find the sum of Bitwise AND of the sum of all leaf nodes… Read More

Given an array arr[] consisting of N positive integers, the task is to modify every array element by reversing their binary representation and count the… Read More

Given two integers N and S, the task is to find a circular permutation of numbers from the range [0, 2(N – 1)], starting with… Read More

Given an array arr[] of size N, the task is to find the maximum and minimum sum of Bitwise XOR of all pairs from an… Read More