Minimize sum of absolute values of A[i] - (B + i) for a given array
Given an array arr[ ] of size N, the task is to find the minimum possible value of the expression abs(arr[1] - (b + 1)) + abs(arr[2] - (b + 2)) . . . abs(arr[N] - (b + N)), where b is an independent integer. Input: arr[ ] = { 2, 2, 3, 5, 5 }Output: 2Explanation: Considering b = 0: The value of the e