# Category Archives: Bit Magic

Given two integers X and Y, and an integer K, the task is to find the minimum number of operations to make X equal toâ€¦ Read More
Given three positive integers X, Y, and Z and an integer N, the task is to make them equal by adding 2i-1 for the ithâ€¦ Read More
Given two integers N and M denoting the size of an array and the sum of the elements of the array, the task is toâ€¦ Read More
Given an integer N, the task is to construct an array of N distinct elements (arr[i] â‰¤ N+1) such that the bitwise XOR of everyâ€¦ Read More
Given an array arr[] of size N and an integer K, the task is to find the count of all the ordered pairs (i, j)â€¦ Read More
Given a non-negative integer N, the task is to find the square root of N using bitwise operations. If the integer is not the perfectâ€¦ Read More
Given two integers S and X representing the sum and bitwise XOR respectively of two integers, the task is to find the count of allâ€¦ Read More
Given an array arr[] of size N, the task is to find if there exists a pair in the array, such that their bitwise XORâ€¦ Read More
Given an integer K and an array arr[] of size N, the task is to choose two elements from the array in such a wayâ€¦ Read More
Given a binary matrix arr[][] of N rows and M columns. The task is to find the number of cells in the matrix, where Bitwiseâ€¦ Read More
Given an array arr[] containing N positive integers, the task is to add an integer such that the bitwise Xor of the new array becomesâ€¦ Read More
Given an integer N, the task is to count the number of integers (say x) in the range [0, 2Nâˆ’1] such that xâŠ•(x+1) = (x+2)âŠ•(x+3).â€¦ Read More
Given a number N, the task is to find the number of zero’s in base K representation of the given number, where K > 1.â€¦ Read More
Given a positive integer N, the task is to find the minimum number of subtractions of power of 2 required to convert N to 0.â€¦ Read More
Given an integer N, the task is to find all possible integer M in the range [2, N] such that the bitwise OR of allâ€¦ Read More