Skip to content

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

Start Your Coding Journey Now!