## Reduce a number to 1 by performing given operations | Set 2

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 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… 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.… Read More »

Given a positive integer N, the task is to find a number which contains (N – 1) set bits in its binary form at every… Read More »

Given an array arr[] and an integer K, the task is to count the pairs whose sum of set bits is K Examples: Input: arr[]… Read More »

Given two arrays A[] and B[] of N elements each. The task is to find the number of index pairs (i, j) such that i… Read More »

Given a tree, and the weights of all the nodes and an integer x, the task is to find a node i such that weight[i]… Read More »