Given N nodes valued by [1, N], an array arr[] consisting of N positive integers such that the ith node ( 1-based indexing ) has… Read More

# Category Archives: Bit Magic

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

Given an array arr[] consisting of N strings, the task is to find the maximum product of the length of the strings arr[i] and arr[j]… Read More

Given a binary matrix mat[][] of dimensions N * N, the task is to check if Bitwise AND of the decimal numbers obtained by concatenating… Read More

Given a binary string S, the task is to print all distinct decimal numbers that can be obtained by generating all permutations of the binary… Read More

Given an integer N, the task is to find the absolute difference between the number of set bits present in the number N and in… Read More