# Category Archives: Bit Magic

Given an integer K, the task is to find three distinct integers A, B and C such that  ( A ∣ B ) & (… Read More
Given an array A[] of N integers and an integer K, the task is to find the minimum number of replacements of array elements required… Read More
Given an array A of N integers, where: Each element of array represents the bit size of an imaginary unsigned integer datatype. If ith imaginary… Read More
Given an integer N (which is always a power of 2) denoting the length of an array which contains integers in range [0, N-1] exactly… Read More
Given two integers X and Y, the task is to find the minimum number of operations required to make X equal to Y by performing… Read More
Given an array A[] of length N, the task is to find the minimum possible value of bitwise OR of the elements after removing at… Read More
Given an array Arr[] of size N, the task is to find the count of subsets of Arr[] that can be partitioned into two non-empty… Read More
Given an A “1″s, B “10”s, and C “0”s, the task is to count of sum of “10” subsequences for each 1s in the string… Read More
Given a linked list containing N nodes of binary numbers, the task is to check whether it is possible to rearrange the linked list in… Read More
Given a binary string S of length N. Distribute 0s and 1s of the string into K groups such that: Each group consists atleast a… Read More
Given array of integers arr[] and queries[] of size N and Q, the task is to find the largest index for each query Q[i] such… Read More
Given an array B1[] and a binary array B2[] each of size N, the task is to rearrange array B1[] in a way such that… Read More
Given an array arr[] of N numbers (N ≤ 20), the task is to find the number of Derangements of the array where array elements… Read More
Given an array A[] of length N and an integer K, the task is to maximize the value of expression [i.j – K.(Ai | Aj)]… Read More
Given an array arr[] of size N. Find the minimum sum of the array after performing given operations any number of times: Select two different… Read More