With a max word length of 30 characters.. Even if you are just using a limited character set of a-z and A-Z that's a huuuge number of different combinations. And if you scale up to unicode it grows even more. It's impossible to find a hashing or compression algorithm that won't produce collisions for 0 < N < 50000
You're welcome. Though I kinda misunderstood what was required so it doesn't do any hashing of the words. It just counts them.
But I guess you can use it as an example on how to create a linked list or whatever