Skip to content

Tag Archives: setBitCount

Given two integers(less than 2^31) A and B. The task is to find the number of bits that are different in their binary representation. Examples: … Read More
Given a sum and a number . The task is to count all possible ordered pairs (a, b) of positive numbers such that the two positive integers… Read More
Given an integer . Find the number of solutions of which satisfies the equation:  a = b + (a^b) Examples:  Input: a = 4 Output: 2 The… Read More
Given a Binary Tree. The task is to print the number of set bits in each of the nodes in the Binary Tree. Recommended: Please… Read More
Given two integers, the task is to find the hamming distance between two integers. Hamming Distance between two integers is the number of bits that… Read More
Given a non-negative number and two values and . The problem is to check whether or not N has an alternate pattern in its binary representation in the… Read More
Given a non-negative integer N. The task is to invert the bits of the number N and print the decimal equivalent of the number obtained… Read More
Given a number N, the task is to check whether the count of the set and unset bits in the given number are same. Examples:   Input:… Read More
  Write an efficient program to count the number of 1s in the binary representation of an integer.Examples :  Input : n = 6Output :… Read More

Start Your Coding Journey Now!