def countArrayElements(array):
 elements = []
 counters = []
 for element in array:
  if (element in elements):
   indx = elements.index(element)
   counters[indx] += 1
  else:
   elements.append(element)
   counters.append(1)
 return (elements, counters)

def countArrayElements ( array ) : elements = [ ] counters = [ ] for element in array : if ( element in elements ) : indx = elements . index ( element ) counters [ indx ] += 1 else : elements . append ( element ) counters . append ( 1 ) return ( elements , counters )
simple method to count the repetitions of elements in an array .