LeetCode192 solution

Printing out Word Frequency

The original problem is https://leetcode.com/problems/word-frequency/. In fact, counting word frequency is a typical application of bash. For example, Example 16-12 in this bash guide.

..................

LeetCode195 solution

Printing out Tenth Line

The original problem is https://leetcode.com/problems/tenth-line/. This is a basic application of bash: just get the 10th line from a file. Many methods can solve this simple question.

..................

LeetCode194 solution

How to transpose a file with bash

The original problem is https://leetcode.com/problems/transpose-file/. This question is difficult for one who is not familiar with the bash tools, such as awk. The first time I tried with a column-by-column handling with sed:

..................

LeetCode193 solution

Valid Phone Numbers

The original problem is https://leetcode.com/problems/valid-phone-numbers/. The basic problem here to match lines of telephone numbers in form of 123-456-789 (123) 456-789

..................