[Python3] 3 Lines O(N)
\nclass Solution:\n    def minElements(self, nums: List[int], limit: int, goal: int) -> int:\n        total = sum(nums)\n        diff = abs(total - goal)\n     
```\nclass Solution:\n    def minElements(self, nums: List[int], limit: int, goal: int) -> int:\n        total = sum(nums)\n        diff = abs(total - goal)\n        return 0 if diff == 0 else 1 if diff <= limit else diff // limit + 1 if diff % limit else diff // limit\n```
[]