Simple Brute force
\n# Code\n\nclass Solution(object):\n    def minSum(self, nums1, nums2):\n        a = nums1.count(0)\n        b = nums2.count(0)\n        if(sum(nums1)==sum(num
\n# Code\n```\nclass Solution(object):\n    def minSum(self, nums1, nums2):\n        a = nums1.count(0)\n        b = nums2.count(0)\n        if(sum(nums1)==sum(nums2) and a>0 and b>0):\n            if(a>b):\n                return sum(nums1)+a\n            else:\n                return sum(nums2)+b\n\n        if(sum(nums1)<sum(nums2) and a==0):\n            return -1\n        elif(sum(nums2)<sum(nums1)and b==0):\n            return -1\n\n        if abs(sum(nums1)-sum(nums2)) < a+b and (a==0 or b==0):\n            return -1\n\n        if sum(nums1)+a>sum(nums2)+b:\n            maxx = sum(nums1)\n            return maxx+a\n        else:\n            maxx = sum(nums2)\n            return maxx+b\n        \n\n\n```
['Python']