28 lines
536 B
Plaintext
28 lines
536 B
Plaintext
wordList = http.get("http://wiki.puzzlers.org/pub/wordlists/unixdict.txt").split(char(10))
|
|
|
|
makeKey = function(word)
|
|
return word.split("").sort.join("")
|
|
end function
|
|
|
|
wordSets = {}
|
|
for word in wordList
|
|
k = makeKey(word)
|
|
if not wordSets.hasIndex(k) then
|
|
wordSets[k] = [word]
|
|
else
|
|
wordSets[k].push(word)
|
|
end if
|
|
end for
|
|
|
|
counts = []
|
|
|
|
for wordSet in wordSets.values
|
|
counts.push([wordSet.len, wordSet])
|
|
end for
|
|
counts.sort(0, false)
|
|
|
|
maxCount = counts[0][0]
|
|
for count in counts
|
|
if count[0] == maxCount then print count[1]
|
|
end for
|