## Count of distinct graphs that can be formed with N vertices

Given an integer N which is the number of vertices. The task is to find the number of distinct graphs that can be formed. Since… Read More »

- Generate all permutations of a string that follow given constraints
- XOR of all the elements in the given range [L, R]
- Iterative approach to print all permutations of an Array
- Count pairs of non-overlapping palindromic sub-strings of the given string
- Mobile Numeric Keypad Problem | Set 2
- Number of ways of scoring R runs in B balls with at most W wickets
- Iterative approach to print all combinations of an Array
- Number of subsequences with zero sum
- Product of all Subsequences of size K except the minimum and maximum Elements
- Sum of the distances from every node to all other nodes is maximum
- Number of ways to go from one point to another in a grid
- Find the good permutation of first N natural numbers
- Largest substring with same Characters
- Probability of getting more heads than tails when N biased coins are tossed
- Print all the permutation of length L using the elements of an array | Iterative
- Number of ways to reach the end of matrix with non-zero AND value
- Number of ways to arrange K different objects taking N objects at a time
- Probability of distributing M items among X bags such that first bag contains N items
- Iterative program to generate distinct Permutations of a String
- Number of N length sequences whose product is M
- Count ways to divide circle using N non-intersecting chord | Set-2
- Find the numbers of strings that can be formed after processing Q queries
- Number of ways in which the substring in range [L, R] can be formed using characters out of the range
- Count number of subsets whose median is also present in the same subset
- Number of ways to paint a tree of N nodes with K distinct colors with given conditions
- Find the number of words of X vowels and Y consonants that can be formed from M vowels and N consonants
- Number of Subsequences with Even and Odd Sum | Set 2
- Generate an Array in which count of even and odd sum sub-arrays are E and O respectively
- Number of ways of choosing K equal substrings of any length for every query
- Count arrays of length K whose product of elements is same as that of given array

Given an integer N which is the number of vertices. The task is to find the number of distinct graphs that can be formed. Since… Read More »

Given an array arr[] of size N. The task is to find the number of subsequences whose sum is even and the number of subsequences… Read More »

Given an integer N, the task is to find the ways to choose some balls out of the given N balls such that at least… Read More »

Given an array arr[] of integers, the task is to find the count of permutation of the array such that the permutation is in increasing… Read More »

Given an array of unique elements, we have to find all the permutation of length L using the elements of the array. Repetition of elements… Read More »

Given a string str, the task is to generate all the distinct permutations of the given string iteratively. Examples: Input: str = “bba” Output: abb… Read More »

Given a string s of size N. The task is to find the largest substring which consists of same characters Examples: Input : s =… Read More »

Given four integers X, Y, M and N. The task is to find the number of ways to form a word by choosing X number… Read More »

Given three integers N, X and Y. The task is to find the number of ways to arrange 2*N persons along two sides of a… Read More »

Given a tree with N nodes and N-1 edges with root at 1 and given an array of N-1 integers. The task is to assign… Read More »

Given a number N. The task is to find the number of ways you can draw N chords in a circle with 2*N points such… Read More »

Given three integers N, M, X. The task is to find the probability of distributing M items among X bags such that first bag contains… Read More »

Given two integers N and M, the task is to find the count of possible sequences a1, a2, … of length N such that the… Read More »

Given two integers N and K, the task is to find the count of quadruples of (i, j, k, l) such that 1 ≤ i… Read More »

Given four integers X, Y, M and W. The task is to find the number of ways to choose X men and Y women from… Read More »