JAVA one line solution
\n\n# Code\n\nclass Solution {\n    public int minElements(int[] nums, int limit, int goal) {\n        return (int)(Math.ceil((Math.abs((long)goal-(Arrays.strea
\n\n# Code\n```\nclass Solution {\n    public int minElements(int[] nums, int limit, int goal) {\n        return (int)(Math.ceil((Math.abs((long)goal-(Arrays.stream(Arrays.stream(nums).mapToLong(i->i).toArray()).sum())))*1.0/limit));\n    }\n}\n```\n\n```\n//Convert integer array to long array\nlong[] longArray = Arrays.stream(nums).mapToLong(i -> i).toArray();\n\n//Sum of elements in array integer/long\nlong s= Arrays.stream(longArray).sum();\n```\n\n
['Array', 'Math', 'Greedy', 'Java']