- The counter is case sensitive and counts non-alphanumberic characters. This would be trival to change.
- In the case of a tie, the 5 most frequent go to the characters that appear first.
- The character frquency it found in O(n) time by creating a dict, iterating through the text, and incrementing the value of the charcater key.
- The top five most frequent character is found in O(n) by iterating over the character frquency and keeping track of only the 5 more frequent characters and their frenqucy in a prioity Queue.