Permutations of string

Take as input str, a string. We are concerned with all possible permutations of characters in str. E.g. “abc” can produce following words “abc”, “acb”, “bac”, “bca”, “cab”, “cba”

a. Write a recursive function which returns the count of different permutations for a given string. Print the value returned.

b. Write a recursive function which prints all possible permutations for a given string in the lexicographical order (void is the return type for function).

Input Format
Enter the String

Constraints
None

Output Format
Display the total number of permutations, display the arraylist containing all the permutations, print all the permutations in a space separated manner

Sample Input
abc

Sample Output

6

abc acb bac bca cab cba

solution link: https://ide.codingblocks.com/s/289229

only one test case is passing. how to remove duplicate permutations?

@1799sanya if you just want to remove duplicates then store it in a map or set
(also whats the question link)