LeetCode 1827. Minimum Operations to Make the Array Increasing
Input: nums = [1,1,1]
Output: 3
Explanation: You can do the following operations:
1) Increment nums[2], so nums becomes [1,1,2].
2) Increment nums[1], so nums becomes [1,2,2].
3) Increment nums[2], so nums becomes [1,2,3].Input: nums = [1,5,2,4,1]
Output: 14Input: nums = [8]
Output: 0Solution
Last updated