Python sum and count method
Approach\n\n- Add counts to sums\n- The max of these is the minimum sum.\n- If they are equal, no replacements are necessary and it is possible.\n- If not, it i
# Approach\n\n- Add counts to sums\n- The max of these is the minimum sum.\n- If they are equal, no replacements are necessary and it is possible.\n- If not, it is only possible if there is a replacement in the other nums list.\n\n# Complexity\n- Time complexity: $$O(n)$$  \n- Space complexity: $$O(1)$$\n\n# Code\n```\nclass Solution:\n    def minSum(self, nums1: List[int], nums2: List[int]) -> int:\n        count1 = nums1.count(0)\n        sum1 = sum(nums1) + count1\n        \n        count2 = nums2.count(0)\n        sum2 = sum(nums2) + count2\n        \n        if sum1 == sum2:\n            return sum1\n\n        if sum1 >= sum2:\n            return sum1 if count2 else -1\n        else:\n            return sum2 if count1 else -1\n        \n```
['Python3']