Simple C++ solution
Code\n\nclass Solution {\npublic:\n    int minElements(vector<int>& nums, int limit, int goal) {\n        long long sum=0;\n        for(auto n:nums){\n         
# Code\n```\nclass Solution {\npublic:\n    int minElements(vector<int>& nums, int limit, int goal) {\n        long long sum=0;\n        for(auto n:nums){\n            sum+=n;\n        }\n        long long diff=abs(goal-sum);\n        return diff%limit==0?diff/limit:(int)(diff/limit+1);\n    }\n};\n```
['C++']