Company: Atd_Chartered_27nov
Difficulty: medium
Global Maximum Global Maximum Problem Description Given an array of distinct positive integers sorted in ascending order, create all possible subsequences with exactly m elements. The goal is to find the maximum possible minimum absolute difference between any two elements in all m -element subsequences of the array. In other words: For each subsequence of length m , find the minimum absolute difference between any pair of its elements. Find the maximum value among all of these minimum differences. The following pseudocode describes the logic: globalMaximum = 0 for each subsequence, s, consisting of m elements { currentMinimum = 10 10 for each (x, y) pair of elements in subsequence s { absoluteDifference = abs(x - y) if absoluteDifference globalMaximum { globalMaximum = currentMinimum } } Examples Example 1: Input: arr = [2, 3, 5, 9], m = 3 Output: 3 Explanation: The subsequences of length 3 are: [2, 3, 5] : Min difference = 1 (between 2 and 3) [2, 3, 9] : Min difference = 1 (between 2