Minimum Height Difference Between Distant Peaks
Examples
Example 1:
Input: heights = [1,5,3,9,7], gap = 2
Output: 2
Explanation:
Example 2:
Input: heights = [10,20,30,40], gap = 3
Output: 30
Explanation:
Example 3:
Input: heights = [1,2,3], gap = 5
Output: -1
Explanation: