[Java] Easy Solution with explanation beats 100% Time: O(n), Space O(1)
Approach :\n  Start from index 1\n  if the current element (nums[i]) is less than the previous element(nums[i-1]) then have the difference count to store the di
**Approach :**\n*  Start from `index 1`\n*  if the current element (`nums[i]`) is less than the previous element(`nums[i-1]`) then have the difference `count` to store the difference, also `+1` to make it increasing\n*  Add the difference to the result `count += diff`\n*  Add the difference to the current element `nums[i] += diff`\n*  proceed till the end (`nums.length`)\n*  return `count`\n```\nclass Solution {\n    public int minOperations(int[] nums) {\n        int count = 0;\n        for (int i = 1;i<nums.length;i++){\n            if (nums[i] <= nums[i-1]) {\n                int diff = nums[i-1] - nums[i] + 1;\n                count += diff;\n                nums[i] += diff;\n            }\n        }\n        return count;\n    }\n}\n```
['Java']