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.
Input :
input = "ABC"
Output: :
ACB
BCA
ABC
CBA
BAC
CAB