Given an integer N representing the number of red and blue candies and a matrix mat[][] of size N * N, where mat[i][j] = 1… Read More

# Tag Archives: combionatrics

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

Given three positive integers, L, R, K and an array arr[] consisting of N positive integers, the task is to count the number of ways… Read More

Given three integers A, B and C, the task is to find the value of the expression Since the answer can be very large,… Read More

Given an array arr[] of size N, the task is to count the number of pairs from the given array whose product contains only a… Read More

Given an integer N representing a non-linear equation of the form 2X + 5Y = N, the task is to find an integral pair (X,… Read More

Given an integer X and integer N, the task is to find the number of unique paths starting from the root in N-ary tree such… Read More

Given an integer N denoting the number of dices, the task is to find the probability of the product of numbers appearing on the top… Read More

Given an integer N, the task is to find the number of permutations of integers from the range [1, N] that can form an acyclic… Read More

Given an array arr[] consisting of N integers, the task is to count the total number of pairs of array elements from the given array… Read More

Given three integers N, P, and K, the task is to find the total number of ways to divide N into K integers having sum… Read More

Given two strings, str1 of length N and str2 of length M of distinct characters, the task is to count the number of ways to… Read More