The output of this sort is correct? Just making sure I understand the problem definition.
tr -s ' \t' '\n' < data/small.data | sort | uniq -c | sort -ns
As a hilarious aside - I think I found some issues in /usr/bin/sort on OSX https://opensource.apple.com/tarballs/text_cmds/ 😂
-- update --
This is close - still need to secondary alpha sort
import sys
from collections import Counter
fpath = sys.argv[1]
with open(fpath, 'r') as f:
data = f.read()
freq = Counter(data.split())
result = freq.most_common()
The output of this sort is correct? Just making sure I understand the problem definition.
As a hilarious aside - I think I found some issues in /usr/bin/sort on OSX https://opensource.apple.com/tarballs/text_cmds/ 😂
-- update --
This is close - still need to secondary alpha sort