Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Permutations of a given string

Problem from GeeksForGeeks

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 S itself. A string of length n has n! permutation. Your task is to print all permutations of a given input string in new line.

Examples:

1

Input :

input = "ABC"

Output: :

ACB
BCA
ABC
CBA
BAC
CAB