## Maximum Bitwise AND pair from given range

Given a range [L, R], the task is to find a pair (X, Y) such that L ≤ X < Y ≤ R and X… Read More »

- Subset array sum by generating all the subsets
- Sum of XOR of all subarrays
- Smallest power of 2 which is greater than or equal to sum of array elements
- Number of pairs whose sum is a power of 2
- Meta Binary Search | One-Sided Binary Search
- Sum of bitwise AND of all subarrays
- Printing all subsets of {1,2,3,...n} without using array or loop
- Represent n as the sum of exactly k powers of two | Set 2
- Sum of Bitwise-OR of all subarrays of a given Array | Set 2
- Range Sum Queries and Update with Square Root
- Highest power of two that divides a given number
- Count pairs with Bitwise XOR as EVEN number
- Find k numbers which are powers of 2 and have sum N | Set 1
- Minimum swaps required to convert one binary string to another
- Count unordered pairs (i,j) such that product of a[i] and a[j] is power of two
- Occurrences of a pattern in binary representation of a number
- Minimum number of operations required to sum to binary string S
- Distance between two nodes of binary tree with node values from 1 to N
- Range and Update Sum Queries with Factorial
- Maximum Bitwise AND pair from given range
- Check whether bitwise OR of N numbers is Even or Odd
- Count pairs (A, B) such that A has X and B has Y number of set bits and A+B = C
- Find subsequences with maximum Bitwise AND and Bitwise OR
- First and Last Three Bits
- Subset Sum Queries in a Range using Bitset
- Check if the binary representation of a number has equal number of 0s and 1s in blocks
- Minimum absolute difference between N and a power of 2
- Number of leading zeros in binary representation of a given number
- Find the values of X and Y in the Given Equations
- Count distinct Bitwise OR of all Subarrays

Given a range [L, R], the task is to find a pair (X, Y) such that L ≤ X < Y ≤ R and X… Read More »

There arises several situations while solving a problem where we need to iterate over all possible combinations of an array. In this article, we will… Read More »

Given an array consisting of N positive integers, find the sum of bit-wise and of all possible sub-arrays of the array. Examples: Input : arr[]… Read More »

Given an array containing N positive integers, the task is to find the sum of XOR of all sub-arrays of the array. Examples: Input :… Read More »

Given an array a[] consisting only 0 and 1. The task is to check if it is possible to transform the array such that the… Read More »

Given two numbers and . Find the values of X and Y in the equations. A = X + Y B = X xor Y… Read More »

Given an array q[] of XOR queries of size N (N is a multiple of 4) which describe an array of the same size as… Read More »

Given an integer n, the task is to find the number of possible values of 0 ≤ x ≤ n which satisfy n XOR x… Read More »

Given an integer N, the task is to check if its equivalent binary number has the equal frequency of consecutive blocks of 0 and 1.… Read More »

Given an integer N. The task is to print the decimal equivalent of the first three bits and the last three bits in the binary… Read More »

Given an integer X > 1 and an integer K > 0, the task is to find the greatest odd number < X such that… Read More »

Given an integer N, the task is to find the minimum absolute difference between N and a power of 2. Examples: Input: N = 4… 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 a string pat and an integer N, the task is to find the number of occurrences of the pattern pat in binary representation of… Read More »

Given an array of N numbers where values of the array represent memory sizes. The memory that is required by the system can only be… Read More »