Category Archives: Bit Magic

Given two integers N and K, the task is to find whether it is possible to represent N as the sum of exactly K powers… Read More
Given a XOR linked list, the task is to pairwise swap the elements of the given XOR linked list . Examples: Input: 4 7 9… Read More
Given an XOR linked list, the task is to remove the first node of the XOR linked list. Examples: Input: XLL = 4 < –… Read More
Given a XOR linked list and an integer K, the task is to reverse every K nodes in the given XOR linked list. Examples: Input:… Read More
Given an array arr[] of size N, the task is to empty given array by removing 2i – 1 array elements in each operation (i… Read More
Given an array arr[] of size N, the task is to check if any subarray of size K exists in the array or not, whose… Read More
Given a matrix B[][] of dimensions N * M, the task is to generate a matrix A[][] of same dimensions that can be formed such… Read More
Given an array arr[] consisting of non-negative integers, the task for each array element arr[i] is to print the sum of Bitwise OR of all… Read More
Given a XOR linked list, the task is to reverse the XOR linked list. Examples: Input: 4 <–> 7 <–> 9 <–> 7Output: 7 <–>… Read More
Given an array arr[] of size N and a positive integer K, the task is to check if the array can be split into K… Read More
Given a binary matrix M[][] of dimensions N x N, the task is to make every pair of adjacent cells in the same row or… Read More
Given two arrays arr1[] of size M and arr2[] of size N, the task is to find the sum of bitwise AND of each element… Read More
Given an array Arr[] of N ( 1 ≤ N ≤ 105)integers, the task is to generate an array B[] consisting of N non-zero elements,… Read More
Given an integer N, the task is to find the decimal value of the binary string formed by concatenating the binary representations of all numbers… Read More
Given an integer N, the task is to find the minimum number of coins of the form 2i required to make a change for N… Read More