Another Permutation Word Conundrum... With Linq?

Posted by CraigF on Stack Overflow See other posts from Stack Overflow or by CraigF
Published on 2010-12-17T15:34:32Z Indexed on 2010/12/22 0:54 UTC
Read the original article Hit count: 193

Filed under:
|
|

I have seen many examples of getting all permutations of a given set of letters. Recursion seems to work well to get all possible combinations of a set of letters (though it doesn't seem to take into account if 2 of the letters are the same).

What I would like to figure out is, could you use linq (or not) to get all possible combinations of letters down to 3 letter combinations.

For example, given the letters: P I G G Y I want an array of all possible cominations of these letters so I can check against a word list (scrabble?) and eventually get a list of all possible words that you can make using those letters (from 3 letters up to the total, in this case 5 letters).

© Stack Overflow or respective owner

Related posts about LINQ

Related posts about permutation