minimum operations to make the array increasing
https://leetcode.com/problems/minimum-operations-to-make-the-array-increasing/
Input: nums = [1,1,1]
Output: 3
Input: nums = [1,5,2,4,1]
Output: 14
Input: nums = [8]
Output: 0
Initial wrong attempt:
class Solution:
def minOperations(self, nums: List[int]) -> int:
minimum replacements to sort the array
Misc Problem Info
Difficulty: Easy
Tags: adp related to greedy
Backlinks