O(n) python code
Intuition\nThe minimum num = sum of array + number of zeros\n\n# Approach\ncheck the code \n\n# Complexity\n- Time complexity:\nO(n)\n\n- Space complexity:\nO(n
# Intuition\nThe minimum num = sum of array + number of zeros\n\n# Approach\ncheck the code \n\n# Complexity\n- Time complexity:\nO(n)\n\n- Space complexity:\nO(n)\n\n# Code\n```\nclass Solution:\n    def minSum(self, nums1: List[int], nums2: List[int]) -> int:\n        sum1=sum(nums1)\n        sum2=sum(nums2)\n        \n\n        zeros1=sum([1 if i==0 else 0 for i in nums1])\n        zeros2=sum([1 if i==0 else 0 for i in nums2])\n\n\n        num_min1=sum1+zeros1\n        num_min2=sum2+zeros2\n\n        print(f\'num_min1={num_min1}\')\n        print(f\'num_min2={num_min2}\')\n        print(f\'zeros1={zeros1}\')\n        print(f\'zeros2={zeros2}\')\n\n        if zeros1 == 0 and num_min2>num_min1:\n            return -1\n        elif zeros2 == 0 and num_min1>num_min2:\n            return -1\n        else:\n            return max(num_min1,num_min2)\n\n\n```
['Python3']