# Tag Archives: Permutation and Combination

## Count of ways to select K consecutive empty cells from a given Matrix

Given a binary matrix V[][] of dimensions N * M, wherein each cell is either empty or blocked marked by a 0 and 1 respectively,… Read More »

## Count of ways to make Array sum even by removing only one element

Given an array arr[] positive integers, the task is to find the number of ways to convert the array sum even if we are allowed… Read More »

## Count of groups among N people having only one leader in each group

Given N number of people, the task is to count the number of ways to form groups of size ≤ N where, in each group,… Read More »

## Count of ways to distribute N items among 3 people with one person receiving maximum

Given an integer N, the task is to find the total number of ways to distribute N among 3 people such that: Exactly one person… Read More »

## Check if all objects of type A and B can be placed on N shelves

Given two integers A and B, representing the count of objects of two different types, and another integer N which represents the number of shelves,… Read More »

## Number of ways to reach (M, N) in a matrix starting from the origin without visiting (X, Y)

Given four positive integers M, N, X, and Y, the task is to count all the possible ways to reach from top left(i.e., (0, 0))… Read More »

## Order of teams in a tournament such that every team has won against its consecutive team

Given N teams and the results of round-robin tournament in which no match resulted is draw or tie. The task is to find the order… Read More »

## Count of substrings consisting only of vowels

Given a string S, the task is to count all substrings which contains only vowels. Examples: Input: S = “geeksforgeeks” Output: 7 Explanation: Substrings {“e”,… Read More »

## Count of triplets in a given Array having GCD K

Given an integer array arr[] and an integer K, the task is to count all triplets whose GCD is equal to K. Examples: Input: arr[]… Read More »

## Find the Nth row in Pascal’s Triangle

Given a non-negative integer N, the task is to find the Nth row of Pascal’s Triangle. Note: The row index starts from 0. Pascal’s Triangle:… Read More »

## Sum of all subsequences of length K

Given an array arr[]and an integer K, the task is to find the sum of all K length subsequences from the given array. Example: Input:… Read More »

## Count of subsequences which consists exactly K prime numbers

Given an integer K and an array arr[], the task is to find the number of subsequences from the given array such that each subsequence… Read More »

## Count of K length subsequence whose product is even

Given an array arr[] and an integer K, the task is to find number of non empty subsequence of length K from the given array… Read More »

## Number of ways to write N as a sum of K non-negative integers

Given two positive integers N and K, the task is to count the number of ways to write N as a sum of K non-negative… Read More »

## Number of ways to color N-K blocks using given operation

Given N blocks out of which K are colored. These K colored blocks are denoted by an array arr[]. The task is to count the… Read More »