Command to count word frequencey


  • 0
    G

    Approach #1 Using bash command to count word frequency

    Shell

    cat words.txt | tr ' ' '\n' | awk 'NF' | sort | uniq -c | awk '{print $2" "$1}' | sort -rn -k2,2
    

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.