Data update
This commit is contained in:
parent
35bcdeebf8
commit
74c69a0df6
2427 changed files with 31826 additions and 3468 deletions
27
Task/Anagrams/MiniScript/anagrams.mini
Normal file
27
Task/Anagrams/MiniScript/anagrams.mini
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
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
|
||||
Loading…
Add table
Add a link
Reference in a new issue