Reputation: 81
I wish to calculate how many times each number appears in the array.
The numbers are all between 1 - 10
So for example: {1,2,2,5,5,6,7,8,2) Would return 3 instances for '2'. And 2 instances for '5' and 1 instance for the rest.
What is the best way to do this, other then me creating 10 for loops?
Upvotes: 1
Views: 56