Skip to content

Tag Archives: Permutation and Combination

Given a string S and an integer K, the task is to find the total number of strings that can be formed by inserting exactly… Read More
Problem Description On a busy road, multiple cars are passing by. A simulation is run to see what happens if brakes fail for all cars… Read More
Given an array arr[] of n integers and an integer K, the task is to find the number of ways to select exactly K even… Read More
Given an integer K and an array arr[] which denotes the amount that can be stolen, the task is to choose a subset of items… Read More
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
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
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
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
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
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
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
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
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