14 lines
336 B
Text
14 lines
336 B
Text
output =
|
|
readFileLines("unixdict.txt")
|
|
|> reduce(logWord, {})
|
|
|> vals
|
|
|> getMax
|
|
|> printLines
|
|
|
|
logWord(dict, word) =
|
|
(dict with $[chars] = [word] ++ getDefault(dict, [], chars))
|
|
where chars = sort(word)
|
|
|
|
getMax(groups) =
|
|
groups |> filter(g => length(g) == maxLength)
|
|
where maxLength = groups |> map(length) |> maximum
|