# Tag Archives: Bitwise-OR

Given an array arr[] of integers and an integer K, we can perform the Bitwise OR operation between any array element and K any number… Read More
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 array “arr[0..n-1]” of integers. The task is to calculate the sum of Bitwise OR of all pairs, i.e. calculate the sum of “arr[i]… Read More
Given two integers N and K, the task is to find N distinct integers whose bit-wise OR is equal to K. If there does not… 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 OR of all… 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 an array of strings arr[]. The task is to find the count of unordered pairs of strings (arr[i], arr[j]), which in concatenation includes each… Read More
Given an array arr[] of N integers, the task is to count the pairs of indices (i, j) such that 0 ≤ i < j… Read More
Given an array arr[] of binary strings, the task is to calculate the bitwise OR of all of these strings and print the resultant string.Examples:  … Read More
Given a NxN matrix, the task is to find the sum of bit-wise OR of all of its rectangular sub-matrices.Examples:   Input : arr[][] = {{1,… Read More
Given an array arr[] and an integer K, the task is to count the number of sub-arrays having bitwise OR ≥ K. Examples: Input: arr[]… Read More
Given an array[] of N positive integers and M queries. Each query consists of two integers L and R represented by a range. For each… Read More
Give an array of positive integers. The task is to find the total sum after performing the bitwise OR operation on all the sub-arrays of… Read More
Given an array of positive integers. The task is to find the size of the smallest subset such that the Bitwise OR of that set… Read More