Easy Greedy intuitive
\n# Code\n\nclass Solution {\npublic:\n    int minElements(vector<int>& nums, int limit, int goal) {\n         //int sum=0; \n         long long sum=0; \n      
\n# Code\n```\nclass Solution {\npublic:\n    int minElements(vector<int>& nums, int limit, int goal) {\n         //int sum=0; \n         long long sum=0; \n         for(int i=0;i<nums.size();i++){\n             sum +=nums[i];\n         }\n         if(sum == goal)return 0; \n         long long needed = goal-sum; \n         needed = abs(needed);\n         if(needed%limit == 0)return needed/limit; \n         \n         return needed/limit+1; \n    }\n};\n```
['Greedy', 'C++']