# 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