zoukankan      html  css  js  c++  java
  • 【leetcode】bash脚本练习

    【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 the
    the sunny is is
    Your script should output the following, sorted by descending frequency:
    
    the 4
    is 3
    sunny 2
    day 1
    Note:
    
    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    

  • 相关阅读:
    【ICLR2018】Mixup 解读
    MobileNetV2 解读
    MobileNetV1 解读
    AdaIN 解读
    心灵奇旅
    SA-Net: Shuffle Attention for Deep Convolutional Neural Networks
    ShuffleNet V1 解读
    情人节看《唐探3》
    拆弹人
    内卷常态下的就业烦恼
  • 原文地址:https://www.cnblogs.com/zhangwanying/p/10010102.html
Copyright © 2011-2022 走看看