Intuitive solution that takes sum + count of zeros
Intuition\nWe\'re going to have to return some kind of val_x = sum(nums_x) + nums_x.count(0). The question is how do you know if you cannot form a sum?\n\nIt se
# Intuition\nWe\'re going to have to return some kind of `val_x = sum(nums_x) + nums_x.count(0)`. The question is how do you know if you cannot form a sum?\n\nIt seems you can only not form the sum if you have 0s missing in the array with the smaller `val_x`\n\n# Approach\nNo rigorous proof of why this intution works, but it seems to pass all test cases. \n\n# Complexity\n- Time complexity:\nO(N)\n\n- Space complexity:\nConstant\n\n# Code\n```\nclass Solution:\n    def minSum(self, nums1: List[int], nums2: List[int]) -> int:\n        nums1_sum = sum(nums1) + nums1.count(0)\n        nums2_sum = sum(nums2) + nums2.count(0)\n\n        if nums1_sum != nums2_sum and 0 not in (nums2 if nums1_sum > nums2_sum else nums1):\n            return -1 \n\n        return max(nums1_sum, nums2_sum)\n```
['Python3']