Java || Greedy || 1ms || beats 100% in time and memory || T.C - O(N) S.C - O(1)
\n    public int minElements(int[] nums, int limit, int goal) {\n        \n        int count = 0,len = nums.length;\n        long sum = 0;\n        for(int i=0;
\n    public int minElements(int[] nums, int limit, int goal) {\n        \n        int count = 0,len = nums.length;\n        long sum = 0;\n        for(int i=0;i<len;i++)\n            sum+=nums[i];\n                \n        if(sum == goal)\n            return 0;\n        \n        long diff = Math.abs(goal - sum);\n        \n        int rem = (int) (diff%limit);\n        int quot = (int) (diff/limit);\n        \n        if(rem == 0)\n            return quot;\n        \n        return quot+1;\n    }\n
[]