Hey, so i came across this little problem today. I cant figure the best way to find how many same strings are in an array. I tried checking every second string if they are the same but thats not the way to go.
Note: I arranged them all in alphabetical order to make it easier to work with, but still i cant figure it out. Any IDEAS? :D
Since you started with them sorted it makes it easy to travel the list and at each change of value you can get the current count from the last change , reset count at change point and keep travelling, comparing last with current, and counting.