##
Minimum bitwise operations to convert given a into b.
September 22, 2017

Given two positive integer a and b you have to change a to b by applying any of the three operations on binary form of… Read More »

September 22, 2017

Given two positive integer a and b you have to change a to b by applying any of the three operations on binary form of… Read More »

Given two numbers n and k, we need to find the minimum number of flips required to maximize given number by flipping its bits such… Read More »

Given a number n, count unset bits after MSB (Most Significant Bit). Examples: Input : 17 Output : 3 Binary of 17 is 10001 so… Read More »

September 19, 2017

Given a non-negative number n and two values l and r. The problem is to set the bits in the range l to r in… Read More »

September 18, 2017

Given a positive number n, count total bit in it. Examples: Input : 13 Output : 4 Binary representation of 13 is 1001 Input :… Read More »

Given a number, find the most significant bit number which is set bit and which is in power of two Examples: Input : 10 Output… Read More »

September 17, 2017

Given a non-negative number n and two values l and r. The problem is to check whether all the bits are unset or not in… Read More »

September 14, 2017

Given a number, toggle all bits of it after most significant bit including most significant bit. Examples: Input : 10 Output : 5 Binary representation… Read More »

September 11, 2017

You are given a positive number k, we need to find a positive integer n, such that XOR of n and n+1 is equal to… Read More »

September 10, 2017

Given a number check whether it is power of 8 or not. Examples: Input : n = 64 Output : Yes Input : 75 Output… Read More »

Given a number you have to check whether there is pair of adjacent set bit or not. Examples: Input : N = 67 Output :… Read More »

September 8, 2017

Given two non-negative numbers m and n. Find the position of rightmost same bit in the binary representation of the numbers. Examples: Input : m… Read More »

September 7, 2017

Given a non-negative number n and two values l and r. The problem is to check whether all the bits are set or not in… Read More »

September 3, 2017

Given a number n, our task is to find all 1 to n bit numbers with no consecutive 1s in their binary representation. Examples:- Input… Read More »

August 31, 2017

Find the nth number whose binary representation is a palindrome. Do not consider the leading zeros, while considering the binary representation. Consider the 1st number… Read More »