# Category Archives: Bit Magic

Given two integers X and S, the task is to find the minimum length of the sequence of positive integers such that the sum ofâ€¦ Read More
Given an array arr[] of size N and an integer K, the task is to invert the 0 bit (unset bit) of any integer ofâ€¦ Read More
Given an array A[] of size N, the task is to find the last remaining element in a new array B containing all pairwise bitwiseâ€¦ Read More
Given a positive integer N. The task is to print the array in decreasing order in which the numbers are odd powers of 2  andâ€¦ Read More
Given two positive integers A and B, the task is to find the number of integers X such that (AâŠ•X ) & B = 0â€¦ Read More
The XOR operation between two numbers P and Q can be looked in a different way as the bitwise sum modulo 2 on the bitsâ€¦ Read More
Given a positive integer N, the task is to find all pairs of integers (i, j) from the range [1, N] in increasing order ofâ€¦ Read More
Given binary strings S1 and S2 of length N, the task is to check if S2 can be made equal to S1 by performing theâ€¦ Read More
Given an array of size N. Consider all the subarrays starting at each index from [0, N – 1]. Determine the length of the smallestâ€¦ Read More
Given an integer N denoting the size of an array and two arrays containing Bitwise AND and Bitwise OR of adjacent elements of the arrayâ€¦ Read More
Given an array Arr[] of N integers and an integer K, the task is to find if it is possible to make the count ofâ€¦ Read More
Given an array A[] of positive integers, print all the unique non-empty subsets of the array  Note: The set can not contain duplicate elements, soâ€¦ Read More
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