# Category Archives: Bit Magic

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 the length of the strings arr[i] and arr[j]… 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
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 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