Algorithm · IBM · Hard
Given an integer array arr, find the largest increment that can be applied to one or more elements so that the array becomes strictly ascending. Rules Elements next to one another may not both be modified. Every array value is an integer. Input An integer array arr containing the original values. Output Return an integer equal to the maximum increment that can be applied while making arr strictly ascending. Example Input: arr = [1, 2, 6, 5, 3] Output: 4 Explanation: Increase…