You are given an integer array nums and two integers limit and goal. The array nums has an initial sum that you want to adjust so that the sum of all elements becomes equal to goal.
To achieve this, you can append elements to the array where each appended element limit.
Return the minimum number of elements you need to append so that the sum of the array equals goal.
Constraints:
nums.length
limit
limit nums[i] limit
goal
You are given an integer array nums and two integers limit and goal. The array nums has an initial sum that you want to adjust so that the sum of all elements becomes equal to goal.
To achieve this, you can append elements to the array where each appended element limit.
Return the minimum number of elements you need to append so that the sum of the array equals goal.
Constraints:
nums.length
limit
limit nums[i] limit
goal