Given two integers L and R. The task is to find the count of all numbers in the range [L, R] whose Least Significant Bit… Read More

# Tag Archives: Bit Algorithms

Given an array arr[] of N pairs, where each array element denotes a query of the form {L, R}, the task is to find the… Read More

Given an unweighted and undirected graph consisting of N nodes and two integers a and b. The edge between any two nodes exists only if… Read More

Given three numbers N, A, and X, the task is to construct the lexicographically smallest binary array of size N, containing A 0s and having… Read More

Bit Manipulation is a technique used in a variety of problems to get the solution in an optimized way. This technique is very effective from… Read More

Given an array arr[] consisting of N and an integer K, the task is to print the elements of arr[] whose rightmost set bit is… Read More

Given an integer N, the task is to print all the subsets of the set formed by the set bits present in the binary representation… Read More

Given two integers N and K, the task is to find whether it is possible to represent N as the sum of exactly K powers… Read More

Given an array arr[] consisting of non-negative integers, the task for each array element arr[i] is to print the sum of Bitwise OR of all… Read More

Given two integers X and S, the task is to construct a sequence of distinct integers from the range [1, X] such that the sum… Read More

Given a positive integer N, the task is to perform the following sequence of operations on the binary representation of N in C. Finding a… Read More

Given six positive integers representing the Bitwise XOR and Bitwise AND of all possible pairs of a triplet (a, b, c), the task is to… Read More

Given two integers X and Y, representing Bitwise XOR and Bitwise AND of two positive integers, the task is to calculate the Bitwise OR value… Read More

Given two positive integers A and B, the task is to flip the common set bitsin A and B. Examples: Input: A = 7, B… Read More

Given an integer N, the task is to find the minimum positive product of first N – 1 natural numbers, i.e. [1, (N – 1)],… Read More