Java || One Pass
\tclass Solution {\n    \n\t\tpublic int minElements(int[] nums, int limit, int goal) {\n        \n\t\t\tlong sum = 0, temp;\n\n\t\t\tfor(int i : nums)\n\t\t\t\
\tclass Solution {\n    \n\t\tpublic int minElements(int[] nums, int limit, int goal) {\n        \n\t\t\tlong sum = 0, temp;\n\n\t\t\tfor(int i : nums)\n\t\t\t\tsum += i;\n\t\t\tif(sum == goal) // if sum and goal is equal then no element is required  \n\t\t\t\treturn 0;\n\t\t\ttemp = Math.abs(sum - goal);\n\t\t\treturn  (int)((temp / limit) + ((temp % limit) > 0 ? 1 : 0)); // calculate the elements needed\n\t\t}\n\t}
['Math', 'Java']