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

# Category Archives: Bit Magic

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 integer N representing the number of red and blue candies and a matrix mat[][] of size N * N, where mat[i][j] = 1… 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 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 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