Skip to content

Commit 1529be2

Browse files
committed
Create 192.word-frequency.sh
1 parent 93d0927 commit 1529be2

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

192.word-frequency.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# https://leetcode.cn/problems/word-frequency/
2+
# Date: 2023.08.04
3+
# Pass/Error/Bug: 1/2/0
4+
# 执行用时: 0 ms, 击败 100.00% 使用 Bash 的用户
5+
# 内存消耗:3.54 MB, 击败 69.43% 使用 Bash 的用户
6+
7+
# Read from the file words.txt and output the word frequency list to stdout.
8+
sed 's/ \+/\n/g' words.txt | grep -v '^$' | sort | uniq -c | sort -k1nr | awk '{print $2, $1}'

0 commit comments

Comments
 (0)