GroupBy method - number of occurrence of an element

Linq has provided a method called GroupBy which groups the elements of a sequence according to a specified key selector function.