Data update
This commit is contained in:
parent
52a6ef48dd
commit
157b70a810
604 changed files with 14253 additions and 2100 deletions
|
|
@ -1,26 +1,18 @@
|
|||
import os
|
||||
|
||||
fn main(){
|
||||
words := os.read_lines('unixdict.txt')?
|
||||
|
||||
words := os.read_lines('unixdict.txt')!
|
||||
mut m := map[string][]string{}
|
||||
mut ma := 0
|
||||
for word in words {
|
||||
mut letters := word.split('')
|
||||
letters.sort()
|
||||
sorted_word := letters.join('')
|
||||
if sorted_word in m {
|
||||
m[sorted_word] << word
|
||||
} else {
|
||||
m[sorted_word] = [word]
|
||||
}
|
||||
if m[sorted_word].len > ma {
|
||||
ma = m[sorted_word].len
|
||||
}
|
||||
if sorted_word in m {m[sorted_word] << word}
|
||||
else {m[sorted_word] = [word]}
|
||||
if m[sorted_word].len > ma {ma = m[sorted_word].len}
|
||||
}
|
||||
for _, a in m {
|
||||
if a.len == ma {
|
||||
println(a)
|
||||
}
|
||||
if a.len == ma {println(a)}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue