Java 4 lines
\n\n# Code\n\nclass Solution {\n    public int minElements(int[] nums, int limit, int goal) {\n        long sum = 0;\n        for (int x:nums){sum+=x;}\n       
\n\n# Code\n```\nclass Solution {\n    public int minElements(int[] nums, int limit, int goal) {\n        long sum = 0;\n        for (int x:nums){sum+=x;}\n        long toFind = Math.abs(goal-sum);\n        return (int)(toFind/limit) + (toFind % limit !=0 ? 1 : 0);\n    }\n}\n```
['Java']