# Category Archives: Combinatorial

Given three integers N, A, and B, the task is to find a permutation of pairwise distinct numbers from 1 to N such that Aâ€¦ Read More
Given an integer n and an array of characters S, the task is to generate Lyndon words of length n having characters from S. Aâ€¦ Read More
Given an integer n and an array of characters S, the task is to generate Lyndon words of length n having characters from S. Aâ€¦ Read More
Given a binary string str, the task is to find the count of K length subarrays containing only 1s. Examples: Input: str = “0101000”, K=1Output:â€¦ Read More
Given K permutations of numbers from 1 to N in a 2D array arr[][]. The task is to find the longest common subsequence of theseâ€¦ Read More
Given an integer N, the task is to find the count of triplets (a, b, c) such that a <= b <= c and aâ€¦ Read More
Given two integers N and K, the task is to calculate the minimum number of adjacent swaps of digits required to make the integer Nâ€¦ Read More
Given an integer N in the range [0, 109], the task is to find the maximum product of two integers that are formed by dividingâ€¦ Read More
Given a number N, the task is to count the combinations of K numbers from 1 to N having a sum equal to N, withâ€¦ Read More
Given two strings A and B having lower case English alphabets, the task is to find the number of operations required to convert string Aâ€¦ Read More
Given two arrays arr1[] and arr2[] having N integers in non-decreasing order, the task is to find the count of non-decreasing arrays arr3[] of lengthâ€¦ Read More
Given two arrays a[] and b[] of length N and M respectively, sorted in non-decreasing order. The task is to find the number of pairsâ€¦ Read More
Given integers N, P, and Q the task is to find the number of ways to form a group of N people having at leastâ€¦ Read More
Given positive integers N, X and Y. The task is to find the count of unique binary strings of length N having X 0s andâ€¦ 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