## Queries for count of array elements with values in given range with updates

Given an array arr[] of size N and a matrix Q consisting of queries of the following two types: 1 L R : Print the… Read More »

- Find XOR of all elements in an Array
- Count of subarrays of an Array having all unique digits
- Check if a Number is Odd or Even using Bitwise Operators
- Bitwise AND of all the elements of array
- Count number of binary strings without consecutive 1’s : Set 2
- Program to find the Nth natural number with exactly two bits set
- Bitwise XOR of a Binary array
- Count maximum occurrence of subsequence in string such that indices in subsequence is in A.P.
- Maximum number of set bits count in a K-size substring of a Binary String
- Number of subsets with same AND, OR and XOR values in an Array
- XOR of elements in a given range with updates using Fenwick Tree
- Largest number in the Array having frequency same as value
- XOR of every element of an Array with a given number K
- Find a Mother vertex in a Graph using Bit Masking
- Find the largest number smaller than integer N with maximum number of set bits
- Find a number such that maximum in array is minimum possible after XOR
- Count subarrays with sum equal to its XOR value
- Find the XOR of the elements in the given range [L, R] with the value K for a given set of queries
- Maximize count of 0s in left and 1s in right substring by splitting given Binary string
- Count of subarrays of size K with elements having even frequencies
- Find the remainder when N is divided by 4 using Bitwise AND operator
- Turn off the rightmost set bit | Set 2
- Find the length of the Largest subset such that all elements are Pairwise Coprime
- XOR of pairwise sum of every unordered pairs in an array
- Number of integers in a range [L, R] which are divisible by exactly K of it's digits
- Count of elements in an Array whose set bits are in a multiple of K
- std::bit_or in C++ with Examples
- Minimum flips required to keep all 1s together in a Binary string
- Count of distinct XORs formed by rearranging two Binary strings
- Sum of bit differences for numbers from 0 to N

Given an array arr[] of size N and a matrix Q consisting of queries of the following two types: 1 L R : Print the… Read More »

Given an integer N, the task is to calculate the sum of first N natural numbers adding all powers of 2 twice to the sum.… Read More »

Given a number N, the task is to find the sum of Hamming difference of consecutive numbers from 0 to N. Hamming Distance between two… Read More »

Given two integers A and B, the task is to print the integer among the two, which will be converted to an odd integer by… Read More »

Given two positive integers S and X which represents the sum and Bitwise XOR of all the elements of an array arr[]. The task is… Read More »

Given an array integer arr[] of size N and Q queries. Each query is of the form (L, R), where L and R are indices… Read More »

Given an array arr[] of N positive integers and a number K, the task is to find the maximum value of bitwise OR of the… Read More »

Given a positive integer N, the task is to find the largest integer M such that 0 <= M < N and XOR(M, N) is… Read More »

Given a binary string s and a number K, the task is to find the maximum number of 0s that can be replaced by 1s… Read More »

Given a positive integer N, the task is to find out the sum of all consecutive bit differences from 0 to N. Note: If the… Read More »

Given an array arr[], the task is to generate a modified array such that all its elements are maximized by swapping of bits. Examples: Input:… Read More »

Given an array of N elements which denotes the array representation of binary heap, the task is to find the leaf nodes of this binary… Read More »

Given an array of N elements, the task is to find the minimum value of K such that Bitwise XOR of K with all array… Read More »

Given an array arr[] of length N, the task is to print the number of array elements which cannot form a pair with any other… Read More »

Given an array arr[] of N positive elements, the task is to find the maximum bitwise OR value of a pair from the given array.… Read More »