[JAVA] Simple to understand solution.
\n   public int minElements(int[] nums, int limit, int goal) {\n        long sumOfArrayElements = 0;\n        for (int i = 0; i < nums.length; i++) {\n         
```\n   public int minElements(int[] nums, int limit, int goal) {\n        long sumOfArrayElements = 0;\n        for (int i = 0; i < nums.length; i++) {\n            sumOfArrayElements += nums[i];\n        }\n        if (sumOfArrayElements == goal)\n            return 0;\n\n        long differenceOfGoalAndSum = Math.abs(goal - sumOfArrayElements);\n\n        if (differenceOfGoalAndSum <= limit)\n            return 1;\n\n        long count = differenceOfGoalAndSum / limit;\n        long remainder = differenceOfGoalAndSum % limit;\n\n        if (remainder > 0)\n            return (int)count + 1;\n\n        return (int)count;\n    }\n\t```
[]