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

# Tag Archives: setBitCount

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

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

Given an integer N, the task is to find an integer M formed by taking the rightmost set bit in N i.e. the only set… Read More

Given an integer N, the task is to find the smallest integer X such that it has no odd position set and X ≥ N. Note:… Read More