Given an array arr[] consisting of N positive integers and an array of queries Q[] of type [L, R], the task is to find the… Read More

# Category Archives: Bit Magic

Given an array arr[] consisting of N integers and a positive integer K, the task is to find the sum of all the subsets of… Read More

Given 3 integers A, B, C, the task is to find the maximum XOR value of three number selected one from each range [0, A],… Read More

Given two positive integers X and Y, the task is to find whether a point (X, Y) can be reached from the point (0, 0)… Read More

Given an array A[] consisting of N integers, the task is to check if it is possible to reduce array of at least length 2… Read More

Given two arrays A[] and B[] consisting of N positive integers, the task is to the Bitwise XOR of same indexed array elements after rearranging… Read More

Given two integers X and Y, the task is to find two numbers whose Bitwise OR is X and their sum is Y. If there… Read More

Given two integers N and X, the task is to generate an array of size N, such that the prefix xor array of X with… Read More

Given a positive integer N, the task is to find the two smallest integers A and B such that the Bitwise XOR of A and… Read More

Given two integers N and K, the task is to find the number of N-length arrays that satisfies the following conditions: The sum of the… Read More

Given a positive integer N, the task is to count the number of N-digit numbers such that the count of distinct odd and distinct even… Read More

Given two binary arrays, A[] and B[] of size N respectively, the task is to find the number of elements in array A[] that will… Read More

Given a binary string str[] of size N and an integer M. This binary string can be modified by flipping all the 0’s to 1… Read More

Given a binary tree, the task is to compress all the nodes on the same vertical line into a single node such that if the… Read More

Given an integer N, the task is to reduce N to 0 in the minimum number of operations using the following operations any number of… Read More