C++ SOLUTION
Approach\n Describe your approach to solving the problem. \n1. Find the sum of array.\n2. Calculate its absolute difference from the goal.\n3. Then return the c
# Approach\n<!-- Describe your approach to solving the problem. -->\n1. Find the sum of array.\n2. Calculate its absolute difference from the goal.\n3. Then return the ceil of diff/limit.\n\nGitHub: [1785. Minimum Elements to Add to Form a Given Sum](https://github.com/Shantanuubasu/Leetcode/blob/main/Array/1785.%20Minimum%20Elements%20to%20Add%20to%20Form%20a%20Given%20Sum.cpp)\n\n# Code\n```\nclass Solution {\npublic:\n    int minElements(vector<int>& nums, int limit, int goal) {\n        ios::sync_with_stdio(false);\n        cin.tie(NULL);\n        cout.tie(0);\n\n        long sum=accumulate(nums.begin(),nums.end(),0L);\n        long diff=abs(goal-sum);\n        return ceil((double)diff/limit);\n    }\n};\n```
['Array', 'Greedy', 'C++']