Permutations of a String
00:00
AmazonTCSAdobe
Generate all permutations of a given string. Handle duplicate characters by returning only unique permutations.
Examples
Input → s='abc'
Output → ['abc','acb','bac','bca','cab','cba']
Input → s='aa'
Output → ['aa']
Explanation:
only unique
Input → s='a'
Output → ['a']