【leetcode】bash脚本练习
发布日期:2021-10-23 14:13:01 浏览次数:9 分类:技术文章

本文共 777 字,大约阅读时间需要 2 分钟。

【192】Word Frequency   

Write a bash script to calculate the frequency of each word in a text file words.txt.

For simplicity sake, you may assume:

  • words.txt contains only lowercase characters and space ' ' characters.
  • Each word must consist of lowercase characters only.
  • Words are separated by one or more whitespace characters.
Example:Assume that words.txt has the following content:the day is sunny the thethe sunny is isYour script should output the following, sorted by descending frequency:the 4is 3sunny 2day 1Note:Don't worry about handling ties, it is guaranteed that each word's frequency count is unique.Could you write it in one-line using Unix pipes?

 

 

【193】Valid Phone Numbers    

【194】Transpose File   

【195】Tenth Line    

转载于:https://www.cnblogs.com/zhangwanying/p/10010102.html

转载地址:https://blog.csdn.net/weixin_30588827/article/details/98892425 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:【Leetcode周赛】从contest-111开始。(一般是10个contest写一篇文章)
下一篇:Java基础之Scanner类中next()与nextLine()方法的区别

发表评论

最新留言

表示我来过!
[***.240.166.169]2024年04月14日 22时08分45秒

关于作者

    喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!

推荐文章