Easy To Understand Solution
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:\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        zero_cnt_1,zero_cnt_2=0,0\n        sum_1,sum_2=0,0\n        for num in nums1:\n            if num == 0:\n                zero_cnt_1+=1\n            else:\n                sum_1+=num\n\n        for num in nums2:\n            if num == 0:\n                zero_cnt_2+=1\n            else:\n                sum_2+=num\n        \n\n        sum_1+=zero_cnt_1\n        sum_2+=zero_cnt_2\n        if sum_1 > sum_2 and zero_cnt_2 == 0:\n            return -1\n        \n        if sum_2 > sum_1 and zero_cnt_1 == 0:\n            return -1\n            \n        return max(sum_1,sum_2) \n```
['Python3']