## Count of values of x <= n for which (n XOR x) = (n – x)

Given an integer n, the task is to find the number of possible values of 0 ≤ x ≤ n which satisfy n XOR x… Read More »

- Subset array sum by generating all the subsets
- Calculate the total fine to be collected
- Remove duplicates from a string in O(1) extra space
- Find triplets in an array whose AND is maximum
- Smallest power of 2 which is greater than or equal to sum of array elements
- Number of pairs whose sum is a power of 2
- Accolite Interview Experience (On-campus)
- Hamming distance between two Integers
- Value in a given range with maximum XOR
- Number of values of b such that a = b + (a^b)
- Printing all subsets of {1,2,3,...n} without using array or loop
- Sum of Bitwise-OR of all subarrays of a given Array | Set 2
- Meta Binary Search | One-Sided Binary Search
- Sum of bitwise OR of all subarrays
- Count pairs with Bitwise XOR as EVEN number
- Number of solutions of n = x + n ⊕ x
- Number of special pairs possible from the given two numbers
- Length of longest consecutive zeroes in the binary representation of a number.
- Range Sum Queries and Update with Square Root
- Set the rightmost off bit
- Represent n as the sum of exactly k powers of two | Set 2
- Minimum absolute difference between N and a power of 2
- Program to find the N-th term of series 3, 5, 33, 35, 53…. | Set-2
- Check whether bitwise OR of N numbers is Even or Odd
- Occurrences of a pattern in binary representation of a number
- Maximum value of XOR among all triplets of an array
- Count unordered pairs (i,j) such that product of a[i] and a[j] is power of two
- Subset Sum Queries in a Range using Bitset
- Find k numbers which are powers of 2 and have sum N | Set 1
- Count pairs (A, B) such that A has X and B has Y number of set bits and A+B = C

Given an integer n, the task is to find the number of possible values of 0 ≤ x ≤ n which satisfy n XOR x… Read More »

Given an integer N, the task is to check if its equivalent binary number has the equal frequency of consecutive blocks of 0 and 1.… Read More »

Given an integer N. The task is to print the decimal equivalent of the first three bits and the last three bits in the binary… Read More »

Given an integer X > 1 and an integer K > 0, the task is to find the greatest odd number < X such that… Read More »

Given an integer N, the task is to find the minimum absolute difference between N and a power of 2. Examples: Input: N = 4… Read More »

Given two integers n and k, the task is to find whether it is possible to represent n as the sum of exactly k powers… Read More »

Given a string pat and an integer N, the task is to find the number of occurrences of the pattern pat in binary representation of… Read More »

Given an array of N numbers where values of the array represent memory sizes. The memory that is required by the system can only be… Read More »

Given a positive integer . Find the number of steps required to minimize it to 1. In a single step N either got reduced to… Read More »

Given two numbers N and K. The task is to print K numbers which are powers of 2 and their sum is N. Print -1… Read More »

Given an array arr[], the task is to count all the valid pairs from the array. A pair (arr[i], arr[j]) is said to be valid… Read More »

Given a binary string S. Find the minimum number of operations required to be performed on the number zero to convert it to the number… Read More »

Given a array arr[], the task is to count the numbers which can be made power of 2 with the following operation: 1 can be… Read More »

Given an array arr[] of positive integers, the task is to count the maximum possible number of pairs (arr[i], arr[j]) such that arr[i] + arr[j]… Read More »

Given an array arr[], the task is to calculate the sum of the elements from the given array which has even parity i.e. the number… Read More »