Skip to content

Category Archives: Bit Magic

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
Given an array arr[] consisting of N positive integers, the task is to count the number of subarrays whose Bitwise OR of its elements even.… Read More
Given an array arr[] consisting of N integers and an integer K, the task is to print an array generated such that the sum of… Read More
Given an array arr[] consisting of values of N vertices of an initially unconnected Graph and an integer M, the task is to connect some… Read More
Given an array arr[] consisting of N non-negative integers and an integer M, the task is to find the count of unordered pairs {X, Y}… Read More
Given a 3D matrix mat[][][] of dimensions N * N * N consisting of positive integers, the task is to calculate Bitwise XOR of all… Read More
Given a binary array arr[] of size N and a positive integer K, the task is to find the minimum number of times any subarray… Read More
Given a matrix arr[][] of dimensions M*N, the task is to convert every matrix element to Bitwise XOR of digits present in the element. Examples:… Read More
Given an array arr[] consisting of N integers, the task is to find the size of the set S such that Bitwise XOR of any… Read More
Given an array arr[] consisting of N positive integers, the task is to find the maximum sum of Bitwise AND of same-indexed elements of permutation… Read More
Given an array arr[] of size N, the task is to count the number of subarrays from the given array whose Bitwise XOR  is even.… Read More
Given a XOR Linked List and a positive integer K, the task is to reverse the last K nodes in the given XOR linked list.… Read More
Given an array arr[] consisting of N positive integers, the task is to find the sum of all array elements having a distinct count of… Read More