Skip to content

Latest commit

 

History

History
12 lines (7 loc) · 522 Bytes

Word_Count_Engine.md

File metadata and controls

12 lines (7 loc) · 522 Bytes

#Word Count Engine

Implement a document scanning engine that receives a text document doc and returns a list of all unique words in it and their number of occurrences, sorted by the number of occurrences in descending order.

Example:

for doc: "practice makes perfect. get perfect by practice. just practice!"

the engine returns the list: { practice: 3, perfect: 2,  makes: 1, get: 1, by: 1, just: 1 }.

The engine should ignore punctuation and white-spaces.

Find the minimal runtime complexity and analyze it.