Company: Amazon_26sep
Difficulty: medium
Maximum Final Element Problem Description As part of your Day 1 orientation at Amazon, your new team is hosting a programming challenge. You've been asked to participate in completing the following task. Given an array of integers, perform certain operations in order to satisfy some constraints. The constraints are as follows: The first array element must be 1. For all other elements, the difference between adjacent integers must not be greater than 1. In other words, for 1 <= i < n, arr[i] - arr[i-1] <= 1. To accomplish this, the following operations are available: Rearrange the elements in any way. Reduce any element to any number that is at least 1. What is the maximum value that can be achieved for the final element of the array by following these operations and constraints? Function Description Complete the function maximumFinal in the editor below. The function maximumFinal has the following parameter: int arr[n] : an array of integers Returns: int : the maximum value th