easy code (conditional logic only)  beats 100%
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: O(N)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: O(1)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    long long minSum(vector<int>& nums1, vector<int>& nums2) {\n        long long sum1 = 0, sum2 = 0, z1 = 0, z2 = 0;\n        for (int num : nums1) {\n            sum1 += num;\n            if (num == 0) z1++;\n        }\n        for (int num : nums2) {\n            sum2 += num;\n            if (num == 0) z2++;\n        }\n        if (z1 == 0 && z2 == 0) {\n            return (sum1 == sum2) ? sum1 : -1;\n        }\n        long long maxSum = max(sum1, sum2);\n        if (sum1 == 0 && sum2 == 0) {\n            return max(z1, z2);\n        }\n        if (z1 == 0 && (sum2 + z2 > sum1)) {\n            return -1;\n        }\n        if (z2 == 0 && (sum1 + z1 > sum2)) {\n            return -1;\n        }\n        if (sum1 == sum2) {\n            return sum1 + max(z1, z2);\n        }\n        if ((sum1 > sum2 && z1 > z2) || (sum1 < sum2 && z1 < z2)) {\n            return maxSum + max(z1, z2);\n        }\n        return max(sum1 + z1, sum2 + z2);\n    }\n};\n\n```
['Array', 'Math', 'C++']