WalaWiki content from p1k3.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

11 lines
463 B

<[Alan]> This is definitely one of my favorite programming interview questions to ask. If they get it right, you can move on to golf...did I ever show you these?
Whole-word anagram finder:
$ perl -e 'sub f{join"",sort split//,pop};$w=f($/.pop);die grep f($_)eq$w,<>' /usr/share/dict/words bread
Partial-word anagram finder:
$ perl -e 'sub f{join pop,sort split//,pop};$w=f($/.pop,"");die grep $w=~(f($_,"+")."+"),<>' /usr/share/dict/words bread