【题解】leetcode_Word Frequency
2015-03-22 22:45
169 查看
看到最近leetcode出了shell编程训练题,有兴趣做了一下,发现还是蛮难的,提供个参考答案,希望发现更好的shell代码的同学能回复哈。
sed -e "s/[ ]*$//g" words.txt | sed -e "s/^[ ]*//g" | sed 's/\s\+/\n/g' | sort | uniq -c | sort -k1nr | awk '{print $2, $1}'
相关文章推荐
- LeetCode题解:Construct the Rectangle
- 【题解】【排列组合】【回溯】【Leetcode】Generate Parentheses
- LeetCode简易题解--105、106
- Leetcode 16. 3Sum Closest 题解
- [LeetCode]题解(python):025-Reverse Nodes in k-Group
- LeetCode题解——Container With Most Water
- leetcode题解-141. Linked List Cycle
- LeetCode 22. Generate Parentheses 题解 —— Java
- LeetCode题解——Longest Common Prefix
- leetcode题解
- leetcode题解-566. Reshape the Matrix && 495. Teemo Attacking
- LeetCode 167. Two Sum II - Input array is sorted 题解(C++)
- LeetCode题解——Add Binary
- Leetcode题解 219. Contains Duplicate II
- 2. Add Two Numbers LeetCode题解
- LeetCode题解: Number Complement
- leetcode题解||ZigZag Conversion问题
- 再从萌新开始-Leetcode每日题解-740. Delete and Earn
- LeetCode No.76 Minimum Window Substring 题解
- leetcode237题 题解 翻译 C语言版 Python版