😊Runtime 76 ms  Beats 100.00% of users with Go
Code\n\nfunc minElements(nums []int, limit int, goal int) int {\n\tvar sum int64 = 0\n\tfor _, num := range nums {\n\t\tsum += int64(num)\n\t}\n\n\tdiff := math
# Code\n```\nfunc minElements(nums []int, limit int, goal int) int {\n\tvar sum int64 = 0\n\tfor _, num := range nums {\n\t\tsum += int64(num)\n\t}\n\n\tdiff := math.Abs(float64(goal) - float64(sum))\n\treturn int(math.Ceil(diff / float64(limit)))\n}\n```
['Go']