## Next greater number on the basis of precedence of digits

Given a number num containing n digits. The problem is to find the next greater number using the same set of digits in num on… Read More »

Given a number num containing n digits. The problem is to find the next greater number using the same set of digits in num on… Read More »

Prerequisite : Permutation and Combination Given a polygon of m sides, count number of triangles that can be formed using vertices of polygon. Answer :… Read More »

Given N, we have to find the sum of products of all combination taken 1 to N at a time. In simple words, we have… Read More »

Write a program to print all distinct permutations of a given string in sorted order. Note that the input string may contain duplicate characters. In… Read More »

Given an array of size n of integers in range from 1 to n, we need to find the inverse permutation of that array. An… Read More »

Prerequisite : Permutation and Combination n students appear in an examination, find the number of ways the result of examination can be announced. Answer is… Read More »

Given a number n, find out number of Symmetric Relations on a set of first n natural numbers {1, 2, ..n}. Examples: Input : n… Read More »

Let A and B be two sets, Cartesian productA × B is the set of all ordered pair of elements from A and B A… Read More »

Given a number n, find out number of Reflexive Relation on a set of first n natural numbers {1, 2, ..n}. Examples: Input : n… Read More »

Given N, count the number of ways to express N as sum of 1, 3 and 4. Examples: Input : N = 4 Output :… Read More »

Given a string, count how many maximum-length palindromes are present.(It need not be a substring) Examples: Input : str = “ababa” Output: 2 Explanation :… Read More »

There are ‘n’ points in a plane out of which ‘m points are collinear. How many different straight lines can form? Examples: Input : n… Read More »

There are ‘n’ points in a plane, out of which ‘m’ points are co-linear. Find the number of triangles formed by the points as vertices… Read More »

Given a number x, find it’s palindromic selfie number according to selfie multiplicative rule. If such a number doesn’t exist, then print “No such number… Read More »

Given a list of permutation of any word. Find the missing permutation from the list of permutation. Examples: Input : Permutation_given[] = {“ABCD”, “CABD”, “ACDB”,… Read More »