Consider these strings (quotes for clarity, they're not part of the strings).
{"apple", "pear", "cherry", "apple", "cherry", "pear", "apple", "banana"}
The vector returned is {3,1,2,2} since the alphabetically
first word is "apple" which occurs 3 times; the second word
alphabetically is "banana" which occurs once, and the other
words each occur twice.
tvector<string>
tvector<int;>
tvector<int> freqs(const tvector<string>& data)(be sure your method is public)
data = {"apple", "pear", "cherry", "apple", "cherry", "pear", "apple", "banana"}
Returns: {3,1,2,2}
This is the example given above.
data = {"a","b","c",d"}
Returns {1,1,1,1}
data = {"a","a","a"}
Returns {3}