# Category Archives: Bit Magic

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
Given three arrays arr1[], arr2[], and arr3[] consisting of non-negative integers. The task is to find the bitwise XOR of the XOR of all possibleâ€¦ Read More
Two players, Player 1 and Player 2, are given an integer N to play a game. The rules of the game are as follows : â€¦ Read More
Given a binary string str, the task is to find the minimum operations required to convert the binary string in a non-decreasing manner such thatâ€¦ Read More
Given a binary array A[] and an integer X, the task is to check whether it is possible to divide A[] into exactly X non-emptyâ€¦ Read More
Given a positive integer n, write a function to find if it is a power of 2 or not Examples: Input: n = 4 Output:â€¦ Read More