The Wayback Machine - https://web.archive.org/web/20210419224713/https://www.geeksforgeeks.org/category/bit-magic/
Skip to content

Category Archives: Bit Magic

Given an array arr[] consisting of N positive integers, the task is to find the minimum number of bits of array elements required to be… Read More
Given three positives integers A, B, and C, the task is to count the minimum number of flipping of bits required in A and B,… Read More
Given an array arr[] consisting of N integers and integer K, the task is to find the smallest integer X with exactly K set bits… Read More
Given a positive integer N, the task is to find the Nth term of the Ruler Function Series. The Ruler Function Series is a series,… Read More
Given an adjacency matrix adj[][] of an undirected graph consisting of N vertices, the task is to find whether the graph contains a Hamiltonian Path… Read More
Given a square symmetric matrix mat[][] of size N, the task is to find the minimum sum possible of an array arr[] of size N,… Read More
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… Read More
Given a positive integer N, the task is to calculate the sum of all decimals which can be expressed as binary representations of first N… Read More
Given an array arr[] consisting of N strings, the task is to find the maximum product of length of the strings arr[i] and arr[j] for… Read More
Given a binary matrix mat[][] of dimensions N * N, the task is to check if Bitwise AND of the decimal numbers obtained by concatenating… Read More
Given a binary string S, the task is to print all distinct decimal numbers that can be obtained by generating all permutations of the binary… Read More
Given an integer N, the task is to find the absolute difference between the number of set bits present in the number N and in… Read More
Given an array arr[] consisting of N integers, the task is to count the number of pairs whose Bitwise XOR is odd, that can be… Read More
Given an array arr[] consisting of N non-negative integers and a 2D array queries[][] consisting of queries of the type {X, M}, the task for… Read More
Given an array arr[] of size N, the task is to count the number of pairs from the given array such that the Bitwise AND… Read More