Delineate cases based on number of zeroes in array
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 sum1 = 0;\n        long sum2 = 0;\n        long zeroes1 = 0;\n        long zeroes2 = 0;\n        for (int i = 0; i < nums1.length; i++) {\n            sum1 += nums1[i];\n            if (nums1[i] == 0) zeroes1++;\n        }\n        for (int i = 0; i < nums2.length; i++) {\n            sum2 += nums2[i];\n            if (nums2[i] == 0) zeroes2++;\n        }\n        if (sum1 == sum2) {\n            if ((zeroes1==0 && zeroes2>0) || (zeroes1>0 && zeroes2==0)) return -1;\n            else return Math.max(zeroes1, zeroes2) + sum1;\n        }\n        if (zeroes1==0 && zeroes2==0) return -1;\n        else if (zeroes1==0) {\n            if (sum1 < sum2 + zeroes2) return -1;\n            else return sum1;\n        }\n        else if (zeroes2==0){\n            if (sum2 < sum1 + zeroes1) return -1;\n            else return sum2;\n        }\n        if (sum1 + zeroes1 > sum2 + zeroes2) return sum1 + zeroes1;\n        return sum2 + zeroes2;\n       \n    }\n}\n```
['Java']