Count of greater elements for each element in the Array
Given an array arr of integers of size N, the task is to find, for every element, the number of elements that are greater than it.Examples: Input: arr[] = {4, 6, 2, 1, 8, 7} Output: {3, 2, 4, 5, 0, 1}Input: arr[] = {2, 3, 4, 5, 6, 7, 8} Output: {6, 5, 4, 3, 2, 1, 0} Approach: Store the frequencies o