FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
LeetCode-Solutions/Shell/word-frequency.sh at master · fileset/LeetCode-Solutions · GitHub
fileset
LeetCode-Solutions
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
LeetCode-Solutions
/
Shell
/
word-frequency.sh
Copy path
More file actions
More file actions
Latest commit
History
History
History
5 lines (3 loc) · 143 Bytes
Breadcrumbs
LeetCode-Solutions
/
Shell
/
word-frequency.sh
Copy path
File metadata and controls
5 lines (3 loc) · 143 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
#
Time: O(n)
#
Space: O(k), k is number of words
awk
'
{for(i=1;i<=NF;i++) a[$i]++} END {for(k in a) print k,a[k]}
'
words.txt
|
sort -k2 -nr
Back
|
FazBrowse Home
|
New Git URL