# Category Archives: Bit Magic

Given a number N, the task is to convert it into a number in which all distinct digits have the same frequency, by rotating its… Read More
Given an array arr[] consisting of N positive integers. The task is to count the number of different non-empty subsets of arr[] having maximum bitwise… Read More
Given an array arr[] containing N positive integers, the task is to maximize bitwise AND of the arr[] by picking at most one element of… Read More
Bit Stuffing is a process of inserting an extra bit as 0, once the frame sequence encountered 5 consecutive 1’s. Given an array, arr[] of… Read More
Given an array arr[] containing N integers and an integer K, the task is to find the maximum value of the product of Bitwise AND… Read More
Given positive integers N, X and Y. The task is to find the count of unique binary strings of length N having X 0s and… Read More
Given three numbers N, X, and Y, find the count of unique binary strings of length N having at least X 0s and Y 1s.… Read More
Given a number N, the task is to find the total number of balanced binary strings possible of length N. A binary string is said… Read More
Given a binary string str[] of size N. The task is to find the longest balanced substring. A substring is balanced if it contains an… Read More
Given a binary string str consisting of only 0 and 1, where 0 represent an unoccupied position and 1 represent an occupied position. Two players… Read More
Given an array arr[] of N integers, the task is to find the size of the largest subset such that the bitwise AND of all… Read More
Given an array of integers, arr[] of size N (<=16), the task is to partition the array into 2 parts such that the maximum product… Read More
Given an integer N., The task is to find the number of distinct permutations of length N, such that the bitwise AND value of each… Read More
Given a binary array a[] of size N of 1’s and 0’s. The task is to remove an element if a[i-1]+a[i]+a[i+1] is divisible by 3.… Read More
Given two positive integers x and y, check if one integer is obtained by rotating bits of other.  Input constraint: 0 < x, y <… Read More