Easy Readable Solution
Explanation:\ngoal is to find the minimum number of operation so if we are going to perform operation i.e if case is nums[i-1]>=nums[i] then make make nums[i]=n
**Explanation:**\ngoal is to find the minimum number of operation so if we are going to perform operation i.e if case is nums[i-1]>=nums[i] then make make nums[i]=nums[i-1]+1. So cost to make nums[i] equal to (nums[i-1]+1) is nums[i-1] - nums[i] + 1.\n\n**CODE:**\n```\n  public int minOperations(int[] nums) {\n        int operations=0;\n        int prev=nums[0];\n        \n        for(int i=1;i<nums.length;i++){\n            int curr=nums[i];\n            if(curr>prev){\n                prev=curr;\n                continue; // nothing to do\n            }\n            operations+=prev-curr+1;\n            prev=prev+1;\n        }\n        return operations;\n    }\n```\n\n**Complexity:**\n`Time:O(n) and Space:O(1)`\n\nPlease **UPVOTE** if found it helpful and feel free to reach out to me or comment down if you have any doubt.
['Java']