Simple Java Solution
\nclass Solution {\n    public int minElements(int[] nums, int limit, int goal) {\n        long sum = 0;\n        for(int num: nums)\n            sum += num;\n 
```\nclass Solution {\n    public int minElements(int[] nums, int limit, int goal) {\n        long sum = 0;\n        for(int num: nums)\n            sum += num;\n        long diff = Math.abs(sum-goal);\n        return (int) (diff/limit) + (diff%limit>0?1:0);\n    }\n}\n```
['Java']