Given a string with no duplicate characters, return a list with all permutations of the string and all its subsets.
Examples
Set = "abc", all permutations are: ["", "a", "ab", "abc", "ac", "acb", "b", "ba", "bac", "bc", "bca", "c", "cb", "cba", "ca", "cab"].
I know how to do it if I broke up the whole thing into two parts:
- find all subsets
- for each subset, find all permutations
But I am wondering if there is a way to write the DFS helper function to do it in just one step.