Say I have a list of strings like


What I want is a list of all permutations of slist. The result should be something like that


The reason for this is that I want to create a dictionary for password recovery.

  • $\begingroup$ Please try Permutations[slist] $\endgroup$ Commented Nov 2, 2015 at 12:03
  • 1
    $\begingroup$ or Permutations[slist, All]. $\endgroup$
    – Kuba
    Commented Nov 2, 2015 at 12:03

1 Answer 1

StringJoin /@ Rest @ Permutations[slist, Length @ slist]

{"apple", "123", "Car", "apple123", "appleCar", "123apple", "123Car", "Carapple", "Car123", "apple123Car", "appleCar123", "123appleCar", "123Carapple", "Carapple123", "Car123apple"}


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.