Count consecutive pairs of same elements
Given an array arr[], the task is to count the number of pairs formed by consecutive elements in which both of the elements in a pair are same.Examples: Input: arr[] = {1, 2, 2, 3, 4, 4, 5, 5, 5, 5} Output: 5 (1, 2), (4, 5), (6, 7), (7, 8) and (8, 9) are the valid index pairs where consecutive eleme