Quote Originally Posted by monarch_dodra View Post
The code isn't rocket science, that's for sure, but I feel it goes against the "don't write write-only code".
Well and the code has a major disdvantage. Its O(N*N), so it shouldn't be written at all really.

The standard alogithm for frequency counting uses a (hash) map and it's O(N) only. Just one scan of the input array is required. It makes a big difference for big inputs.