Easy to Follow O(n) Python Solution
Intuition\n\n1)  if both the lists have atleast 1 zero, then a solution is possible.\n        We can find the min sum by adding the larger sums with the number 
# Intuition\n\n1)  if both the lists have atleast 1 zero, then a solution is possible.\n        We can find the min sum by adding the larger sums with the number of zeros\n        in that array (since each zero must be replaced by atleast 1)\n\n2) If one of the lists does not contain any zeros, it is possible that the\n        problem has no solutions (eg 2)\n        This problem would occur if the array with the smaller sum does not have any\n        zeros, coz then there is no way for the 2 sums to be equal\n\n\n# Complexity\n- Time complexity: O(n)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: O(1)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution:\n    def minSum(self, nums1: List[int], nums2: List[int]) -> int:\n\n        # Compute initial sum and num of zeros for both the lists\n        sum1 = 0\n        zeros1 = 0\n        for i in range(len(nums1)):\n            sum1 += nums1[i]\n            if nums1[i] == 0:\n                zeros1 += 1\n\n        sum2 = 0\n        zeros2 = 0\n        for i in range(len(nums2)):\n            sum2 += nums2[i]\n            if nums2[i] == 0:\n                zeros2 += 1\n\n        # Solution not possible\n        if (zeros1 == 0 and sum1 < sum2 + zeros2) or (zeros2 == 0 and sum2 < sum1 + zeros1):\n            return -1\n\n        # For the sums to be equal, both would have to be equal to the larger sum\n        return max(sum1 + zeros1, sum2 + zeros2)\n\n        \n\n```
['Python3']