Skip to content

Category Archives: Bit Magic

Given a binary string, S of size N, the task is to check if it is possible to partition the string into disjoint subsequences equal… Read More
Given a Binary string, the task is to find the largest Prime Number possible by the decimal representation of a subsequence of the given binary… Read More
Given two integers A and B, the task is to check if there exists two integers P and Q over the range [1, A] and… Read More
Given an array arr[] consisting of N non-negative integers, the task is to count the number of ways to split the array into three different… Read More
Given an array arr[] of size N and an array Q[], the task is to calculate the sum of Bitwise XOR of all elements of… Read More
Given two arrays A[] and B[] of sizes N, the task is to find the maximum sum of Bitwise AND of same-indexed elements in the… Read More
Given two positive integers A and B representing Bitwise XOR and Bitwise OR of two positive integers, the task is to find all possible pairs… Read More
Given an array arr[] consisting of N positive integers, the task is to rearrange the array such that the reversed binary representation of all the… Read More
Given an array arr[] consisting of N positive integers and a string S of length (N – 1), containing characters ‘+’ and ‘*’, the task… Read More
Given a positive 32-bit integer N, the task is to find the maximum between the value of N and the number obtained by decimal representation… Read More
Given an array arr[] consisting of N positive integers, the task is to find the Bitwise OR of Bitwise AND of all subarrays of the… Read More
Given an array arr[] consisting of N floating-point numbers, the task is to print the decimal representation of the binary array constructed from the absolute… Read More
Given an array arr[ ] consisting of N positive integers and a 2D array Q[][] consisting of queries of the form {i, val}, the task… Read More
Given a positive integer N, the task is to print all the distinct even and odd values of prefix Bitwise XORs of first N natural… Read More
Given two arrays arr1[] and arr2[] consisting of N and M integers respectively, the task is to print the Bitwise XOR of Bitwise AND of… Read More