i know word count Qs has been asked many times and MAP seems to be the unanimous choice for it.
But i felt that MAP might take a lot of space if the text is huge and number of unique words are very high. So why not use a Trie? The leaf node will store the frequency of each word.
Or is it that Map is a clear winner when compared to trie?
Plz help me in understanding.
P.S. It was asked in SDE interview.