Skip to content

Tag Archives: combionatrics

Given an array of pairs arr[] of size N (N ≥ 3) where each element of pair is at most N and each pair is… Read More
Given three numbers N, X, and Y, find the count of unique binary strings of length N having at least X 0s and Y 1s.… Read More
Given an integer N and a vector of strings prefixes[], the task is to calculate the total possible strings of length N from characters ‘0’… Read More
Given an array vec[] of size N of non-negative integers. The task is to count the number of subsequences with the sum equal to S… Read More
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 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 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 a string S consisting of N digits and an integer K, the task is to count the number of ways to remove digits from… Read More
Given an integer N, the task is to paint a grid of size N x 3 using colors Red, Yellow, or Green while making such… Read More
Given a string S of length N, the task is to count the number of anagrams of S whose first character is a consonant and… Read More
Given a binary string S of length N consisting of 0s, 1s, and “?”, where “?” can be replaced by either 0 or 1, the… Read More
Given an integer N, the task is to tile a board of dimensions N * 1 the task is to count the number of ways… Read More