Perl Monk, Perl Meditation | |
PerlMonks |
Re: Solving Anagramsby Zaxo (Archbishop) |
on Jan 24, 2005 at 06:17 UTC ( [id://424509]=note: print w/replies, xml ) | Need Help?? |
Your dictionary will be easier to handle if the values are array references. Either do, $_ = [split /,/] for values %dictionary; or push them on in the first place. Multi-word matching can be done by picking a key that can occur, eliminating its used characters from the sorted string and looking again. Backtrack if you have a residue which has no anagram. After Compline,
In Section
Seekers of Perl Wisdom
|
|