Find the occurrence of every element among all possible subarrays of the array
Given an array with all distinct elements, you need to find the occurrence of every element among all the possible subarrays of the array. Examples: Input: arr[] = { 2 , 1 , 3 } Output: 3,4,3 Explanation : All the possible subarrays are {2},{2,1},{2,1,3},{1},{1,3},{3}. Clearly 2 occurs 3 times 1 occurs 4 times and 3 occurs 3… Read More »
