## 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 »

- Subset array sum by generating all the subsets
- Calculate the total fine to be collected
- Find i’th index character in a binary string obtained after n iterations | Set 2
- Find triplets in an array whose AND is maximum
- Remove duplicates from a string in O(1) extra space
- Accolite Interview Experience (On-campus)
- Number of values of b such that a = b + (a^b)
- Number of special pairs possible from the given two numbers
- Number of solutions of n = x + n ⊕ x
- Value in a given range with maximum XOR
- Sum of Bitwise-OR of all subarrays of a given Array | Set 2
- Sum of bitwise OR of all subarrays
- Hamming distance between two Integers
- Set the rightmost off bit
- Printing all subsets of {1,2,3,...n} without using array or loop
- Count unordered pairs (i,j) such that product of a[i] and a[j] is power of two
- Program to find the N-th term of series 3, 5, 33, 35, 53…. | Set-2
- Count pairs with Bitwise XOR as EVEN number
- Length of longest consecutive zeroes in the binary representation of a number.
- Number of pairs with Bitwise OR as Odd number
- Maximum value of XOR among all triplets of an array
- Check whether bitwise OR of N numbers is Even or Odd
- Check whether product of 'n' numbers is even or odd
- Check whether the given number is Wagstaff prime or not
- Meta Binary Search | One-Sided Binary Search
- Minimum numbers needed to express every integer below N as a sum
- Round to next greater multiple of 8
- Highest power of two that divides a given number
- Count numbers whose difference with N is equal to XOR with N
- Numbers that are bitwise AND of at least one non-empty sub-array

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 »

Given an array arr[] of N integers and number of queries Q. The task is to answer three types of queries. Update [l, r] –… Read More »

Given an array A of N integers and number of queries Q. You have to answer two types of queries. Update [l, r] – for… Read More »

Give an array of positive integers. The task is to find the total sum after performing the bit wise OR operation on all the sub… Read More »

Given a binary tree with as its root and for any parent its left child will be 2*i and right child will be 2*i+1. The… Read More »

Given a binary number, the task is to remove exactly one bit from it such that, after it’s removal, the resultant binary number is greatest… Read More »

Given two numbers n1 and n2. The task is to find the position of first mismatching bit in the binary representation of the two numbers… Read More »

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 »

Given an array of N integers, the task is to find the number of pairs (i, j) such that A[i] ^ A[j] is even. Examples:… 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 two numbers x, y which denotes the number of set bits. Also given is a number C. The task is to print the number… Read More »

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 »

Given a value X, the task is to find the number Y which will give maximum value possible when XOR with X. (Assume X to… Read More »

Given an integer . The task is to find the number of bits changed after adding 1 to the given number. Examples: Input : N… Read More »

Given an array of integers and a number K. The task is to find the XOR of only those elements of the array whose total… Read More »