Given a string S of size N consisting of digits and ?, the task is to find the number of strings formed such that replacing… Read More

# Category Archives: Combinatorial

Given an array arr[] of N integers and an integer K, the task is to find the sum of the difference between the maximum and… Read More

Given an array of N integers the task is to select K elements out of these N elements in such a way that the minimum… Read More

Given an array arr[] of N distinct binary strings each having N characters, the task is to find any binary string having N characters such… Read More

Given an array arr[] of N integers, the task is to find the number of subsequences of the given array such that their Bitwise AND… Read More

Given an array arr[] consisting of N positive integers, the task is to find the number of subsequences from the given array whose Bitwise OR… Read More

Given a string S, in one move it is allowed to remove two adjacent equal characters. After the removal, both endpoints of the removed characters… Read More

Given an array arr[] consisting of N positive integers, the task is to find the number of all possible arrays such that each array element… Read More

Given a number N, the task is to calculate the count of numbers of length N having prime numbers at odd indices and odd numbers… Read More

Given three integers N, M and P, the task is to find the total number of valid arrays that can be created of size P… Read More

Given an array arr[] of size N and Q queries of the form (L, R), the task is to count number of triplets with even… Read More

Given an array A[] of size N, the task is to find the maximum score possible of this array. The score of an array is… Read More

Given two positive integers N and K, the task is to find the mean of the minimum of all possible subsets of size K from… Read More

Given two positive integers N and K, the task is to count the number of even and odd integers consisting of N bits, out of… Read More

Given two integers N and K, find the distinct number of ways to create an array of N elements where each element is in the… Read More