Skip to content

Category Archives: Bit Magic

Given an array X[] of length N, the task is to verify whether each possible subarray has a different bitwise OR value. If possible then… Read More
Given an array A consisting of N positive integers, the task is to calculate the maximum XOR of the subarray of size K consisting of… Read More
Given an array arr[] of size N, Return the number of permutations of array arr[] which satisfy the condition arr[1] & arr[2] & . .… Read More
Given an array arr[] of size N and an integer K, the task is to find the number of pairs in the array such that… Read More
Given an array arr[] of size N ( N is even ), the task is to construct an array B[] such that the sum of… Read More
Given integers L and R, the task for this problem is to find a number of integers in the range L to R whose sum… Read More
Given an array arr[] of length N, the task is to find all the possible odd-length subsequences containing odd elements only. Examples: Input: N =… Read More
Given arrays Arr[] and Queries[] of size N and an integer K such that (0 ≤ Arr[i], Queries[i] < 2K), the task is to form… Read More
Given the number N, count the number of ways to create a binary string (the string that contains characters as zero or one) of size… Read More
Given three integers A, B, and C. the task is to find the maximum possible sum of three numbers when you are allowed to perform… Read More
Given 2 arrays arr1[] and arr2[], of size N and M respectively, the task is to find a pair of value (say a and b)… Read More
Given two values A and B (A, B < 16), the task is to store the numbers in one byte.  Examples: Input: A = 5,… Read More
Given an integer N, the task is to find the number of pairs (say {a, b})from 1 to N (both inclusive) that satisfies the condition: … Read More
Given a positive integer array arr[] of size N, the task is to find the longest subarray such that the bitwise AND of every pair… Read More
Given a number N and its reverse R. The task is to find the number obtained when the number is raised to the power of… Read More

Start Your Coding Journey Now!