C++ 1-liner
We need to divide the difference between the sum and the goal by your limit. \n\nNote that you need one more element if there is remainder (difference  % limit 
We need to divide the difference between the sum and the goal by your limit. \n\nNote that you need one more element if there is remainder (`difference  % limit != 0`).\n\n```cpp\nint minElements(vector<int>& nums, int limit, int goal) {\n    return (abs(accumulate(begin(nums), end(nums), 0l) - goal) + limit - 1) / limit;\n}\n```
[]