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
Category Archives: Bit Magic
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 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