What are some practical uses of generating all permutations of a list, such as ['a', 'b', 'c'] ?
- by Jian Lin
I was asked by somebody in an interview for web front end job, to write a function that generates all permutation of a string, such as "abc" (or consider it ['a', 'b', 'c']).
so the expected result from the function, when given ['a', 'b', 'c'], is
abc
acb
bac
bca
cab
cba
Actually in my past 20 years of career, I have never needed to do…