## Find the count of distinct numbers in a range

Given an array of size N containing numbers only from 0 to 63, and you are asked Q queries regarding it. Queries are as follows:… Read More »

- Find maximum xor of k elements in an array
- Find the number of pair of Ideal nodes in a given tree
- Find XOR of numbers from the range [L, R]
- Count total set bits in all numbers from 1 to n | Set 2
- Equal Sum and XOR of three Numbers
- Count smaller elements on right side and greater elements on left side using Binary Index Tree
- Count of triplets that satisfy the given equation
- Quadruplet pair with XOR zero in the given Array
- Nth XOR Fibonacci number
- Alternate XOR operations on sorted array
- Bit manipulation | Swap Endianness of a number
- Minimum Bitwise OR operations to make any two array elements equal
- Find the Majority Element | Set 3 (Bit Magic)
- Queries to check whether all the elements in the given range occurs even number of times
- Check if a cycle of length 3 exists or not in a graph that satisfy a given condition
- Longest Subarray having strictly positive XOR
- Maximum XOR of Two Numbers in an Array
- Find two integers A and B such that A ^ N = A + N and B ^ N = B + N
- Number formed by the rightmost set bit in N
- Count of elements which are equal to the XOR of the next two elements
- Count total set bits in all numbers from 1 to N | Set 3
- Count number of set bits in a range using bitset
- Count Set-bits of number using Recursion
- Sum of Bitwise OR of all pairs in a given array
- Count number of bits to be flipped to convert A to B | Set-2
- Number of triplets in array having subarray xor equal
- Find number of subarrays with XOR value a power of 2
- Find an N x N grid whose xor of every row and column is equal
- Count number of common elements between two arrays by using Bitset and Bitwise operation
- Array containing power of 2 whose XOR and Sum of elements equals X

Given an array of size N containing numbers only from 0 to 63, and you are asked Q queries regarding it. Queries are as follows:… Read More »

Given a number N in decimal format, the task is to convert it to the hexadecimal representation of N as a string. Negative numbers are… Read More »

Given two integers A and B, the task is to find an integer X such that (X XOR A) is minimum possible and the count… Read More »

Given a number N, the task is to set, clear and toggle the K-th bit of this number N. Setting a bit means that if… Read More »

Given two arrays A[] and B[]. The second array B[] contains all the elements of A[] except for 1 extra element. The task is to… Read More »

Given an array arr[] of N elements, the task is to find the maximum number of consecutive 1’s in the binary representation of an element… Read More »

Given an octal number N, the task is to convert the number to decimal and then find the modulo with every power of 2 i.e.… Read More »

Given an integer array arr1 and a binary array arr2 of same size, the task is to find the maximum possible sum of products of… 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 a positive integer X the task is to find an integer Y such that: The count of set bits is Y is equal to… Read More »

Given an array arr[] of N positive integers, the task is to find an arrangement such that Bitwise AND of the first N – 1… Read More »

Given a binary string S, the task is to find the number of ways to split it into parts such that every part is divisible… Read More »

Given an array arr[], the task is to find the longest subsequence with a given AND value M. If there is no such sub-sequence then… Read More »

Given a binary string S, the task is to find the maximum number of parts that you can split it into such that every part… Read More »

Given an array arr[], the task is to find the longest subsequence with a given OR value M. If there is no such sub-sequence then… Read More »