## Generate all permutation of a set in Python

Permutation is an arrangement of objects in a specific order. Order of arrangement of object is very important. The number of permutations on a set… Read More »

## Find number of solutions of a linear equation of n variables

Given a linear equation of n variables, find number of non-negative integer solutions of it. For example,let the given equation be “x + 2y =… Read More »

## Program to find number of squares in a chessboard

Given an n x n grid, count squares in it. Examples : Input: n = 2 Output: 5 (4 squares of 1 unit + 1… Read More »

## Print all distinct permutations of a given string with duplicates

Given a string that may contain duplicates, write a function to print all permutations of given string such that no permutation is repeated in output.… Read More »

## Anagram Substring Search (Or Search for all permutations)

Given a text txt[0..n-1] and a pattern pat[0..m-1], write a function search(char pat[], char txt[]) that prints all occurrences of pat[] and its permutations (or… Read More »

## Find next greater number with same set of digits

Given a number n, find the smallest number that has same set of digits as n and is greater than n. If n is the… Read More »

## Print all permutations in sorted (lexicographic) order

Given a string, print all permutations of it in sorted order. For example, if the input string is “ABC”, then output should be “ABC, ACB,… Read More »

## Print all permutations with repetition of characters

Given a string of length n, print all permutation of the given string. Repetition of characters is allowed. Print these permutations in lexicographically sorted order… Read More »

## Write a program to print all permutations of a given string

A permutation, also called an “arrangement number” or “order,” is a rearrangement of the elements of an ordered list S into a one-to-one correspondence with… Read More »