You are reading a single comment by @chez_jay and its replies. Click here to read the full conversation.
  • One for the programmers:
    Does anyone know how to get all possible combinations of a list of strings?
    Eg. if i have ["one", "two", "three"]
    I would like:
    "one"
    "two"
    "three"
    "one, two"
    "one, three"
    "two, one"
    "two, three"
    "three, one"
    "three, two"
    "one, two, three"
    "one, three, two"
    "two, one, three"
    "two, three, one"
    "three, one, two"
    "three, two, one"

  • These aren't just combinations (where order doesn't matter) but permutations of your input set, for lengths 1 to length of input set.

  • yeah, it's cool. I ended up having the permutations call inside a loop from 1 to the input length (like you said).

    The results get scarily big very quickly!

About

Avatar for chez_jay @chez_jay started