samedi 25 avril 2015

Grouping based on the order of data

I have a set of data in the following format.

A
A
B
A
C
B
B
C

I want to group the data in such a way that the result should be grouped by alphabet and is should be based on order. For example for the above data the output should be

A - 2
B - 1
A - 1
C - 1
B - 2
C - 1

Aucun commentaire:

Enregistrer un commentaire