## Position of the K-th set bit in a number

Given two numbers N and K. The task is to find the index of the K-th set bit in the number from the right. Note:… Read More »

- Sum of bitwise AND of all subarrays
- Sum of bitwise AND of all submatrices
- Maximum Bitwise AND pair from given range
- Find subsequences with maximum Bitwise AND and Bitwise OR
- Minimum Bitwise AND operations to make any two array elements equal
- Bitwise AND of N binary strings
- Position of the K-th set bit in a number
- Count pairs with Bitwise-AND as even number
- Check whether bitwise AND of a number with any subset of an array is zero or not
- Check whether product of 'n' numbers is even or odd
- Numbers that are bitwise AND of at least one non-empty sub-array
- Round to next greater multiple of 8
- Minimum value among AND of elements of every subset of an array
- Composite XOR and Coprime AND
- Modify a binary array to Bitwise AND of all elements as 1
- Comparing leading zeros in binary representations of two numbers

Given two numbers N and K. The task is to find the index of the K-th set bit in the number from the right. Note:… Read More »

Given an array of integers, the task is to find the AND of all elements of each subset of the array and print the minimum… Read More »

Given a NxN matrix, the task is to find the sum of bit-wise AND of all of its rectangular sub-matrices. Examples: Input : arr[][] =… Read More »

Given an array arr[] of binary strings, the task is to calculate the bitwise AND of all of these strings and print the resultant string.… Read More »

Given a range [L, R], the task is to find a pair (X, Y) such that L ≤ X < Y ≤ R and X… 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 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 an array arr[], the task is to count the number of unordered pairs of indices (i, j) such the gcd(2, a[i]^a[j]) > 1 and… Read More »

Given an array of integers. The task is to find the number of pairs (i, j) such that A[i] & A[j] is even. Examples: Input:… Read More »

Given an array of n elements. The task is to print the maximum sum by selecting two subsequences of the array (not necessarily different) such… Read More »

Given an unsigned integer x. Round it up to the next greater multiple of 8 using bitwise operations only. Examples: Input : 35 Output :… Read More »

Given two Integer numbers x and y. Compare and print which one of them has more leading zeros using Bitwise operation. If both the no.… Read More »

Given an array ‘arr’, the task is to find all possible integers each of which is the bitwise AND of at least one non-empty sub-array… Read More »

Given an array of integers of size ‘n’ and an integer ‘k’, We can perform the Bitwise AND operation between any array element and ‘k’… Read More »

Given an array arr[] containing n numbers. The problem is to check whether the product of the given n numbers is even or odd. Examples:… Read More »