## Number of pairs of arrays (A, B) such that A is ascending, B is descending and A[i] ≤ B[i]

Given two integers N and M, the task is to find the number of pairs of arrays (A, B) such that array A and B… Read More »

- Largest substring with same Characters
- Print all the permutation of length L using the elements of an array | Iterative
- Iterative program to generate distinct Permutations of a String
- Number of Subsequences with Even and Odd Sum | Set 2
- Count the number of subsequences of length k having equal LCM and HCF
- Find a pair (n,r) in an integer array such that value of nCr is maximum
- Count number of binary strings such that there is no substring of length greater than or equal to 3 with all 1's
- Count permutation such that sequence is non decreasing
- Number of words that can be made using exactly P consonants and Q vowels from the given string
- Ways to choose balls such that at least one ball is chosen
- Number of K length subsequences with minimum sum
- Count of distinct graphs that can be formed with N vertices
- Total ways of selecting a group of X men from N men with or without including a particular man
- Number of triangles that can be formed

Given two integers N and M, the task is to find the number of pairs of arrays (A, B) such that array A and B… Read More »

Given an integer N, the task is to count the number of binary strings possible such that there is no substring of length ≥ 3… Read More »

Given 2*N integers which are elements of a prefix and suffix array(in shuffled order) of an array of size N, the task is to find… Read More »

Given an array arr[] of length N, count the number of pairs (i, j) such that arr[i] * arr[j] = arr[i] + arr[j] and 0… Read More »

Given a character X and a string Y of length N and the task is to find the number of ways to convert X to… Read More »

Given a linear board of length N numbered from 1 to N, the task is to find the expected number of moves required to reach… Read More »

Given two integers N and M. At each operation, choose K cells of a 2D grid of size N * M and arrange them. If… Read More »

Given two integers N and K. There are N balls placed in a row. K of them are green and N – K of them… Read More »

Given two integers X and Y. The task is to find the number of ways to reach (X, Y) in a matrix starting from the… Read More »

Given an array arr[] of N integers and an integer M, the task is to find the number of non-empty subsequences such that the sum… Read More »

Fuss–Catalan Numbers are a generalization of Catalan numbers that uses triplets instead of pairs. The Fuss-Catalan Numbers can be represented by a Series with the… Read More »

Given an array arr[] of length N and an integer X, the task is to find the number of subsets with sum equal to X.… Read More »

Given an array arr[] of length N, the task is to find the overall sum of subsets of all the subsets of the array. Examples:… Read More »

Given an array arr[] of N positive integers. The task is to find the count of pairs (arr[i], arr[j]) such that the maximum power of… Read More »

A string is called good if it is made with only digits 0 to 9 and adjacent elements are different. The task is to find… Read More »