Solution python O(n)
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\nO(n)\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\nO(1)\n# Code\n```python3 []\nclass Solution:\n    def minSum(self, nums1: List[int], nums2: List[int]) -> int:\n        sum1 = 0\n        sum2 = 0\n        hasZero1 = False\n        for num in nums1:\n            if num == 0:\n                hasZero1 = True \n                sum1 += 1\n            else: \n                sum1 += num\n        hasZero2 = False\n        for num in nums2:\n            if num == 0:\n                hasZero2 = True \n                sum2 += 1\n            else:\n                sum2 += num\n        \n        if sum1 > sum2:\n            if hasZero2:\n                return sum1\n            else:\n                return -1\n        else: \n            if hasZero1 or sum1 == sum2:\n                return sum2\n            else:\n                return -1\n\n```
['Python3']