Hey guys,
So I came across this little problem that I thought I could solve relatively easily, but it turned out quite messy.
I have this array of strings and I want to find the most frequent entry of that array. Let's say I have the following array.
apple
apple
kiwi
orange
apple
the mode would give me apple. I thought about converting the strings into a number and then find the mode as usual.
But if the string was too long, it seems a single number cant be used to represent it.
Any ideas on a clean way to do this?