g0101_0200.s0192_word_frequency.script.sh Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of leetcode-in-java11 Show documentation
Show all versions of leetcode-in-java11 Show documentation
Java Solution for LeetCode algorithm problems, continually updating
The newest version!
# Read from the file words.txt and output the word frequency list to stdout.
# #Medium #Shell #2022_06_28_Time_143_ms_(54.55%)_Space_3.7_MB_(85.88%)
sed -e 's/ /\n/g' words.txt | sed -e '/^$/d' | sort | uniq -c | sort -r | awk '{print $2" "$1}'