The first of a few problems is:
Given a list of words on stdin (one per line), find the words that have the largest number of anagrams in that list.
Print all of the words that have the meet the criteria of having the largest number anagrams (One per line, in alphabetical order).
This competition has now finished. The winner was Nick Cooper at 103 bytes, with the following awesome solution:
import sys s=sorted o=s(sys.stdin) r=map(s,o) d=map(r.count,r) for e,t in zip(o,d):print e*(max(d)==t),
Input:
caret
crate
react
trace
ester
reset
steer
terse
organ
groanOutput:
caret
crate
ester
react
reset
steer
terse
trace
No mention of second place on 106 bytes? Bah! :P
ReplyDeleteCongrats Nick - and damn you and those three last bytes!