in reply to Finding words within a character set
The keys are the first asciibetical permutation of each word set.my %anagrams; while (defined( my $dict_word = <> ) ) { my $sorted = sort split //, $dict_word; push @{$anagrams{$sorted}} = $dict_word; }
Next, since you want words that are a subset of the given char set, you'll have to run through the combinations of the char set, and check if there's a key that matches, giving you an array of words for each match. I leave that as an exercise for OMAR.
-QM
--
Quantum Mechanics: The dreams stuff is made of
|
|---|