## Find Kth smallest value for b such that a + b = a | b

Given a number a and k, the task is to find the k’th smallest value for b such that a + b = a |… Read More »

- Find maximum xor of k elements in an array
- Find the number of pair of Ideal nodes in a given tree
- 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
- Bit manipulation | Swap Endianness of a number
- 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
- 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
- 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 Set-bits of number using Recursion
- 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
- Array containing power of 2 whose XOR and Sum of elements equals X
- Check whether bitwise AND of N numbers is Even or Odd
- Maximize the Expression | Bit Manipulation
- Find the possible permutation of the bits of N
- Find third number such that sum of all three number becomes prime
- Queries to find the count of integers in a range that contain the given pattern
- Find the maximum possible Binary Number from given string
- Count of N-bit binary numbers without leading zeros
- Count total unset bits in all the numbers from 1 to N
- Maximum distance between two 1's in Binary representation of N

Given a number a and k, the task is to find the k’th smallest value for b such that a + b = a |… Read More »

Given the leaf nodes of a perfect binary tree, the task is to construct the XOR tree and print the root node of this tree.… Read More »

Given a value N and K, the task is to generate N-bits Gray Code starting from the value K. Examples: Input: N = 2, K… Read More »

Given a binary string, the task is to find whether all the digits of the string can be made equal i.e either 0 or 1… Read More »

Given the size of a binary array consisting of 0’s only as n and an integer m which is the number of flips allowed from… Read More »

Given an integer, array A. Find the sum of set bits raised to the power A[i] for each element in A[i]. Example: Input: N =… Read More »

Given an array arr[] of N distinct positive integers, let’s denote max(i, j) and secondMax(i, j) as the maximum and the second maximum element of… Read More »

Given an array arr[] of non-negative integers, let’s define X as the XOR of all the array elements and S as the sum of all… Read More »

Given two integers M and N the task is to find the number formed by concatenating the binary equivalents of M and N i.e. M… Read More »

Given two non-negative integers N and K, the task is to invert the Kth most significant bit of N and print the number obtained after… Read More »

Given an integer N, the task is to find the greatest number that can be obtained by flipping at most K bits in the binary… Read More »

Given an integer N and an infinite number of Full Binary Trees of different depths, the task is to choose minimum number of trees such… Read More »

Two players are playing a series of games of Rock–paper–scissors. There are a total of N games played represented by an array arr[][] where arr[i][0]… Read More »

Given two integer N and K, the task is to find the value of N XOR N XOR N XOR … XOR N (K times).… Read More »

Given a graph with N nodes and M edges where each edge has a color (either black or green) and a cost associated with it.… Read More »