What is the simplest way of getting the number of distinct repeated in a region?
For example, from
THIS IS LINE A
THIS IS LINE A
THIS IS LINE A
THIS IS LINE B
THIS IS LINE B
THIS IS LINE C
I would like to get
THIS IS LINE A 3
THIS IS LINE B 2
THIS IS LINE C 1
The output could be made over the same region (replacing the current selection).