easy O(n) python solution - clear and simple
Intuition\nThe min sum is at least the max of sum of array + # of zeros. In that case, we know for either array, the zeros can be used to add up to the min sum.
# Intuition\nThe min sum is at least the max of sum of array + # of zeros. In that case, we know for either array, the zeros can be used to add up to the min sum. For each array, the sum must either a) equal the min_sum or b) have > 0 zeros to add up to the min sum.\n\n# Complexity\n- Time complexity:\nO(n)\n\n- Space complexity:\nO(1)\n\n# Code\n```\nclass Solution:\n    def minSum(self, nums1: List[int], nums2: List[int]) -> int:\n        n1_sum = sum(nums1)\n        n2_sum = sum(nums2)\n        n1_zeros = nums1.count(0)\n        n2_zeros = nums2.count(0)\n        min_sum = max(n1_sum + n1_zeros, n2_sum + n2_zeros)\n\n        if n1_sum != min_sum and n1_zeros == 0:\n            return -1\n        if n2_sum != min_sum and n2_zeros == 0:\n            return -1\n        return min_sum\n\n```
['Python3']