IPhone: counting unique elements in an array

Moan. I spent hours trying to count the number of unique elements in a sorted array. I basically have A, B, B, B, B, C, C, D, E, M, X, X. All I need to know is that there are 1 A, 4 Bs, 2 Cs and etc. Help evaluate.

+3
source share

All Articles