Company: Google big code_21march
Difficulty: medium
You are given an array of distinct integers. Your task is to find three elements in the array such that the sum of their absolute differences is maximized. For three elements at positions i, j, k (where i The challenge is [unclear] ciently identify the optimal triplet that [unclear] the maximum sum of absolute differences without checking all possible combinations. Function Description: You need to implement the function maxTripletDistance . This function should find three distinct elements from the array that maximize the sum of absolute differences between all pairs. Parameters: n : An integer representing the size of the array arr : An array [unclear] distinct integers Input Format: First line contains a single integer n, the number of elements in the array Second line contains n space-separated distinct integers representing the array elements Output Format: Print a single integer representing the maximum sum of absolute differences for any triplet in the array. Constraints 3 ≤ n ≤