Fastest and Simplest greedy solution - Beats 100% time and 100% memory - With detailed explanation
We start by calculating the total sum of the elements of the array.\n *   We then simplify our problem by making the new goal as abs(goal-sum) and starting sum 
*   We start by calculating the **total sum** of the elements of the array.\n *   We then simplify our problem by making the new goal as **abs(goal-sum)** **and starting sum as 0**.\n *   Then comes the** most important part** --> We\'ve to calculate count by counting the number of times a limit value will come while adding upto the goal. \n   * **To prevent TLE** --> We calculate this by **dividing the goal with the limit**. In case a remainder is left, as t**he remainder will be smaller than the limit**, we simply return the** calculated count + 1** for the remainder.\n```\n int minElements(vector<int>& nums, int limit, int goal) {\n        long long sum = 0;\n        for(int n:nums){\n            sum+=n;\n        }\n        int count = 0;\n        long long tgoal = abs(goal - sum);\n        int min = tgoal/limit;\n        if(tgoal%limit==0)return min;\n        else return min+1;\n    }\n```
['Greedy', 'C++']