Given a number N which is a power of 2. Calculate total number of set bits from 1 to N-1. Examples : Input : N = 8 Output : 12 Explanation : Read more →
Bit-Algorithms
4 postsYou are given a positive integer n, and an array a of positive integers. Find number of such pairs (i,j) such that i<j and ai & aj ≥ ai ^ aj, where Read more →
Given an array of N elements, the task is to find the minimum value of K such that Bitwise XOR of K with all array elements is minimum Input: arr[] 16 12 Read more →
Two numbers: m and n are given. The size of these numbers is 32-bit long. You are also given two-bit positions: i and j. You have to set all bits between i Read more →