You are given an array of positive integers arr. You can perform two types of operations any number of times:
Decrease the value of any element in arr to any smaller positive integer.
Rearrange the elements of arr in any order.
Return the maximum possible value of an element in arr after applying the operations such that arr satisfies the following conditions:
The first element of arr must be equal to
The absolute difference between any two adjacent elements must be at most arrarrarr.length (using
Constraints:
arr.length
arr[i]
You are given an array of positive integers arr. You can perform two types of operations any number of times:
Decrease the value of any element in arr to any smaller positive integer.
Rearrange the elements of arr in any order.
Return the maximum possible value of an element in arr after applying the operations such that arr satisfies the following conditions:
The first element of arr must be equal to
The absolute difference between any two adjacent elements must be at most arrarrarr.length (using
Constraints:
arr.length
arr[i]