Write an efficient program to count the number of 1s in the binary representation of an integer.Examples :...
Given a number N, the task is to write C program to count the number of 0s and 1s in the binary representation of N....
Given two positive integers L and R, the task is to count the total number of set bits in the binary representation of all the numbers from L to R....
Given an array arr[] consisting of N integers and an integer K, the task is to find the minimum sum of incompatibilities of K subsets of equal sizes having unique elements....
Given an array arr[] consisting of N positive integers and a 2D array Q[][] consisting of queries of the type {i, val}, the task for each query is to replace arr[i] by val and calculate the Bitwise AND of the modified array....
Given two arrays arr1[] of size M and arr2[] of size N, the task is to find the sum of bitwise AND of each element of arr1[] with the elements of the array arr2[]....
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:...
Given an array of strings, where each string consists of lowercase characters from a to j. You need to find the maximum number of strings that can be concatenated together such that the resulting string can be made out of exactly k distinct characters....
Given an array arr[] consisting of N integers, the task is to count the total number of pairs of array elements from the given array such that arr[i] * arr[j] is the power of 2....
Given a positive integer N, the task is to find the Nth term of the Ruler Function Series....
Given an array arr[] consisting of N integers and a 2D array Q[][] consisting of queries of the following two types:...
Given two integers N and K, the task is to find whether it is possible to represent N as the sum of exactly K powers of 2. If possible, then print K positive integers such that they are powers of 2 and their sum is exactly equal to N. Otherwise, print “Impossible”. If multiple answers exist, print any....