Skip to content

Instantly share code, notes, and snippets.

@seungjin
Created April 10, 2019 09:46
Show Gist options
  • Save seungjin/2d29f85572ce91d171c5fd697b817c7e to your computer and use it in GitHub Desktop.
Save seungjin/2d29f85572ce91d171c5fd697b817c7e to your computer and use it in GitHub Desktop.
#!/usr/bin/env julia
count = Dict()
for line in eachline(stdin)
for word in split(line)
if haskey(count,word)
count[word] += 1
else
count[word] = 1
end
end
end
for e in sort(collect(count), by=x->x[2], rev=true)
println( first(e), " " , last(e) )
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment