## Count pairs of elements such that number of set bits in their AND is B[i]

Given two arrays A[] and B[] of N elements each. The task is to find the number of index pairs (i, j) such that i… Read More »

- Sum of bitwise AND of all subarrays
- Sum of bitwise AND of all submatrices
- Count pairs of elements such that number of set bits in their AND is B[i]
- Maximum Bitwise AND pair from given range
- Find letter's position in Alphabet using Bit operation
- Position of the K-th set bit in a number
- Bitwise AND of N binary strings
- Queries for bitwise AND in the index range [L, R] of the given array
- Bitwise AND of sub-array closest to K
- Minimum value among AND of elements of every subset of an array
- Total pairs in an array such that the bitwise AND, bitwise OR and bitwise XOR of LSB is 1
- Composite XOR and Coprime AND
- Modify a binary array to Bitwise AND of all elements as 1
- Queries for bitwise AND in the given matrix

Given two arrays A[] and B[] of N elements each. The task is to find the number of index pairs (i, j) such that i… Read More »

Given an N * N matrix mat[][] consisting of non-negative integers and some queries consisting of top-left and bottom-right corner of the sub-matrix, the task… Read More »

Given an array arr[] of N and Q queries consisting of a range [L, R]. the task is to find the bit-wise AND of all… Read More »

Given a string of English alphabets. The task is, for every character in the string print its position in the English alphabets. Note: The characters… Read More »

Given an integer array arr[] of size N and an integer K, the task is to find the sub-array arr[i….j] where i ≤ j and… Read More »

Given an array arr[] of size N. The task is to find the number of pairs (arr[i], arr[j]) as cntAND, cntOR and cntXOR such that:… Read More »

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 »