1785. Minimum Elements to Add to Form a Given Sum Updated: 2024-03-12 1 min read Algorithms , LeetCode On This PageLeetCode problem 1785class Solution: def minElements(self, nums: List[int], limit: int, goal: int) -> int: d = abs(sum(nums) - goal) return (d + limit - 1) // limit