Skip to content

Category Archives: Bit Magic

Given a number N, the task is to find the remainder when N is divided by 4 using Bitwise AND operator. Examples:  Input: N =… Read More
Given a binary string of size N and an integer K, the task is to perform K operations upon the string and print the final… Read More
Given a string S, the task is to count the maximum occurrence of subsequences in the given string such that the indices of the characters… Read More
Given an array arr[] of length N, the task is to find the XOR of pairwise sum of every possible unordered pairs of the array.… Read More
Given two binary strings A and B of equal length N, the task is to find the number of distinct XORs possible by arbitrarily reordering… Read More
Given an array arr of integers of size N and an integer K, the task is to find the XOR of all the numbers which… Read More
Given an array arr[] containing integers of size N, the task is to find the XOR of this array.Examples:  Input: arr[] = {2, 4, 7} Output:… Read More
Given an array arr containing integers of size N, the task is to check if the XOR of this array is even or odd Examples: … Read More
Given an array A and two integers M and K, the task is to check and print “Yes“, if the original array can be retained… Read More
Given a positive integer N, the task is to count all possible distinct binary strings of length N such that there are no consecutive 1’s.… Read More
Given an array arr[] and a number K. The task is to find the count of the element having odd and even number of the… Read More
Given two arrays A[] and B[] having N and M positive elements respectively. The task is to count the number of elements in array A… Read More
Given a binary array arr[] of length N, the task is to find the minimum flips required in the array such that XOR of a… Read More
Given a range of values [L, R] and a value K, the task is to count the numbers in the given range which are divisible… Read More
Given a number N, the task is to check whether the number is even or odd using Bitwise Operators. Examples:   Input: N = 11 Output: Odd… Read More