Very Simple Python Approach for Beginners
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:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution(object):\n    def minSum(self, nums1, nums2):\n        """\n        :type nums1: List[int]\n        :type nums2: List[int]\n        :rtype: int\n        """\n        # Replace 0 with 1 in both lists\n        sum1 = sum(nums1)\n        sum2 = sum(nums2)\n        nums1 = [1 if x == 0 else x for x in nums1]\n        nums2 = [1 if x == 0 else x for x in nums2]\n        new_sum1 = sum(nums1)\n        new_sum2 = sum(nums2)\n        if new_sum1 == sum1 and new_sum2 != sum2:\n            if new_sum2 > new_sum1:\n                return -1\n            else:\n                difference = new_sum1 - new_sum2\n                for i in range(len(nums2)):\n                    if nums2[i] == 1:\n                        nums2[i] == 1 + difference\n                        return new_sum1\n                        break                \n        elif new_sum2 == sum2 and new_sum1 != sum1:\n            if new_sum1 > new_sum2:\n                return -1\n            else:\n                difference = new_sum2 - new_sum1\n                for i in range(len(nums1)):\n                    if nums1[i] == 1:\n                        nums1[i] == 1 + difference\n                        return new_sum2\n                        break\n        elif new_sum2 == sum2 and new_sum1 == sum1:\n            if new_sum2 != new_sum1:\n                return -1\n            else:\n                return new_sum1\n        else:\n            if new_sum1 < new_sum2:\n                difference = new_sum2 - new_sum1\n                for i in range(len(nums1)):\n                    if nums1[i] == 1:\n                        nums1[i] == 1 + difference\n                        return new_sum2\n                        break\n            else: \n                difference = new_sum1 - new_sum2\n                for i in range(len(nums2)):\n                    if nums2[i] == 1:\n                        nums2[i] == 1 + difference\n                        return new_sum1\n                        break\n\n\n\n```
['Python']