## Check if an array can be Arranged in Left or Right Positioned Array

Given an array arr[] of size n>4, the task is to check whether the given array can be arranged in the form of Left or… Read More »

## Count permutations that produce positive result

Given an array of digits of length n > 1, digits lies within range 0 to 9. We perform sequence of below three operations until… Read More »

## MakeMyTrip Interview Experience | Set 11 (Developer Position)

I recently go interviewed for MakeMyTrip Developer position. I had 5 rounds: Round 1: 1) Reverse a Linked List – You should be able to… Read More »

## Heap’s Algorithm for generating permutations

Heap’s algorithm is used to generate all permutations of n objects. The idea is to generate each permutation from the previous permutation by choosing a… Read More »

## BogoSort or Permutation Sort

BogoSort also known as permutation sort, stupid sort, slow sort, shotgun sort or monkey sort is a particularly ineffective algorithm based on generate and test… Read More »

## How to find Lexicographically previous permutation?

Given a word, find lexicographically smaller permutation of it. For example, lexicographically smaller permutation of “4321” is “4312” and next smaller permutation of “4312” is… Read More »

## All permutations of a string using iteration

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 »

## Permutations of a given string using STL

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 »

## Permutation and Combination in Python

Python provide direct methods to find permutations and combinations of a sequence. These methods are present in itertools package. Permutation First import itertools package to… Read More »

## Print all palindrome permutations of a string

Given a string, we need to print all possible palindromes that can be generated using letters of that string. Examples: Input: str = “aabcb” Output:… Read More »

## Permutation Coefficient

Permutation refers to the process of arranging all the members of a given set to form a sequence. The number of permutations on a set… Read More »

## 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 »