## Queries for bitwise OR in the given matrix

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 »

## Queries for bitwise OR in the index range [L, R] of the given array

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 »

## Total pairs in an array such that the bitwise AND, bitwise OR and bitwise XOR of LSB is 1

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 »

## Pairs of strings which on concatenating contains each character of “string”

Given an array of strings arr[]. The task is to find the count of unordered pairs of strings (arr[i], arr[j]), which on concatenation contains each… Read More »

## Count pairs with bitwise OR less than Max

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 »

## Bitwise OR of N binary strings

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.… Read More »

## Sum of Bitwise-OR of all Submatrices

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[][] =… Read More »

## Number of subarrays have bitwise OR >= K

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 »

## Subset Sum Queries in a Range using Bitset

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 »

## Sum of Bitwise-OR of all subarrays of a given Array | Set 2

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 »

## Size of the smallest subset with maximum Bitwise OR

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 »

## Number of pairs with Bitwise OR as Odd number

Given an array A[] of size N. The task is to find the how many pair(i, j) exists such that A[i] OR A[j] is odd.… Read More »

## Number of ways to swap two bit of s1 so that bitwise OR of s1 and s2 changes

Given two binary numbers strings and of length . Find the number of ways of swapping two bits in s1(only s1 not s2) so that… Read More »

## Find subsequences with maximum Bitwise AND and Bitwise OR

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 »

## Assign other value to a variable from two possible values

Suppose a variable x can have only two possible values a and b, and you wish to assign to x the value other than its… Read More »