Given a number X, calculate number of possible pairs (a, b) such that bitwise or of a and b is equal to X and number… Read More

# Tag Archives: setBitCount

Given an array arr[] of N integers and Q queries, each query having two integers L and R, the task is to find the element… Read More

Given an array arr[] containing N positive integers, the task is to find the maximum bitwise OR value of a pair in the given array… Read More

Given binary string str, the task is to maximize the count of 0s in the left substring and 1s in the right substring by splitting… Read More

Given N stairs, the task is to find the minimum number of jumps of perfect power of 2 requires to reach the Nth stair. Examples: … Read More

Given an array arr[] of N elements and an integer K, the task is to count all the elements whose number of set bits is… Read More

Given an array arr[] of N elements, the task is to count all the elements which are a multiple of their set bits count.Examples: Input… Read More

Given an integer N. The task is to reduce the given number N to 1 in minimum number of given operations. You can perform any… Read More

Given two integers N and K, the task is to find the count of set bits in the Kth number in the Odd-Even sequence made… 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 non-negative integer N, the task is to find the count of set bits for every number from 0 to N.Examples: Input: N =… Read More

Given a distance K to cover, the task is to find the minimum steps required to cover the distance if steps can be taken in… Read More

Given a positive integer N, the task is to count the total number of set bits in binary representation of all the numbers from 1… Read More

Pre-requisite: Majority Element, Majority Element | Set-2 (Hashing)Given an array of size N, find the majority element. The majority element is the element that appears… Read More

Given a number N. The task is to find the number of set bits in its binary representation using recursion. Examples: Input : 21 Output :… Read More