Minimum distance between peak elements in a given array
Given an array arr[], the task is to find the minimum distance between the two peak elements in the given array. Examples: Input: arr[] = {2, 3, 1, 2, 4, 1, 2}Output: 2Explanation: The peak elements in the given array are {2, 3, 1, 2, 4, 1, 2}. Hence the distance between 4 and 2 is (6 - 4) = 2 which