Simplest Easily Understandable
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 {\n    public long minSum(int[] nums1, int[] nums2) {\n        long count1 = 0;\n        long count2 = 0;\n        long sum1 = 0;\n        long sum2 = 0;\n        for(int i = 0; i < nums1.length; i++) {\n            sum1 += nums1[i];\n            \n            if(nums1[i] == 0) {\n                sum1 += 1;\n                count1++;\n            }\n            \n        }\n        for(int i = 0; i < nums2.length; i++) {\n            sum2 += nums2[i];\n            if(nums2[i] == 0) {\n                sum2 += 1;\n                count2++;\n            }\n        }\n\n        if(count2 == 0) {\n            if(sum1 > sum2) {\n                return -1;\n            }\n        }\n        if(count1 == 0) {\n            if(sum2 > sum1) {\n                return -1;\n            }\n        }\n\n        return Math.max(sum1, sum2);\n    }\n}\n```
['Java']