Skip to content

Tag Archives: setBitCount

Given an array Arr[] of N integers and an integer K, the task is to find if it is possible to make the count of… Read More
Given two integers N and M denoting the size of an array and the sum of the elements of the array, the task is to… Read More
Given a positive integer N, the task is to find the minimum number of subtractions of power of 2 required to convert N to 0.… Read More
For two integers X and Y are the tasks is to find the number of bits that are the same in their binary representation by… Read More
Given a binary tree having N nodes, the task is to find the level having the maximum number of setbits. Note: If two levels have… Read More
Given an array arr (1-based indexing) of length N and an integer X, the task is to find and print all index ranges having a… Read More
Given two positive integers A and B, perform one of the following operations only once to make the numbers equal.  Change the ith bit of… Read More
Given a binary string str of length N, the task is to find the number of setbits in the bitwise OR of all the K… Read More
Given a number N and an integer K, the task is to set the Kth bit of the number N, i.e., if the Kth bit… Read More
Given a binary matrix arr[][] having N rows and M columns, the task is to calculate the minimum number of operations required to set the… Read More
Given a binary array arr[]. The task is to find the position of any 0 in arr[] such that the distance between two set bits… Read More
Given an array arr[] of N integers, the task is to replace each element of Array with their rank according to Rightmost-Set Bit (RSB) in… Read More
Given an array arr[] containing N integers and an array queries[] containing Q queries in the form of {L, R}, the task is to count… Read More
Given an array arr, the task is to count the total number of set bits in all numbers of that array arr. Example: Input: arr[]… Read More
Given an array arr[] of size N, the task is to find the sum of all XNOR values of all possible unordered pairs from the… Read More

Start Your Coding Journey Now!