Skip to content

Category Archives: Bit Magic

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
Given a positive integer N, the task is to find the count of integers from the range [1, N] such that the integer cannot be… Read More
Given an array arr[] consisting of N integers, the task is to find the product of the count of set bits in the binary representation… Read More
Given N nodes valued from [1, N], an array arr[] consisting of N positive integers such that the ith node ( 1-based indexing ) has… Read More
Given a string S consisting of N lowercase alphabets, the task is to count the number of substrings whose frequency of each character is even.… Read More
Given an array arr[] consisting of N positive integers, the task is to find the maximum absolute difference between the sum of the array elements… Read More
Given an array arr[] consisting of N positive integers, the task is to find the minimum number of bits of array elements required to be… Read More
Given three positives integers A, B, and C, the task is to count the minimum number of flipping of bits required in A and B,… Read More
Given an array arr[] consisting of N integers and integer K, the task is to find the smallest integer X with exactly K set bits… Read More
Given a positive integer N, the task is to find the Nth term of the Ruler Function Series. The Ruler Function Series is a series,… Read More
Given an adjacency matrix adj[][] of an undirected graph consisting of N vertices, the task is to find whether the graph contains a Hamiltonian Path… Read More
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