Check min/max sum
Intuition\n- replace 0 by 1 gives minimal sum of an array\n- maximal sum is actuall sum if no 0. otherwise numeric_limits<>::max()\n- the max of the two min sum
# Intuition\n- replace `0` by `1` gives minimal sum of an array\n- maximal sum is actuall sum if no `0`. otherwise `numeric_limits<>::max()`\n- the max of the two min sum is our solution.\n\n \n# Code\n```\nclass Solution {\npublic:\n    long long minSum(vector<int>& nums1, vector<int>& nums2) {\n        long long sum1 = accumulate(nums1.begin(), nums1.end(), 0LL, [](long long sum, int val) { return sum + val; });\n        long long sum2 = accumulate(nums2.begin(), nums2.end(), 0LL, [](long long sum, int val) { return sum + val; });\n        int zero1 = count(nums1.begin(), nums1.end(), 0);\n        int zero2 = count(nums2.begin(), nums2.end(), 0);\n        long long minsum1 = sum1 + zero1;\n        long long minsum2 = sum2 + zero2;\n        long long maxsum1 = zero1 ? numeric_limits<long long>::max() : sum1;\n        long long maxsum2 = zero2 ? numeric_limits<long long>::max() : sum2;\n        if(minsum1 > maxsum2 || minsum2 > maxsum1)\n            return -1;\n        return max(minsum1, minsum2);\n    }\n};\n```
['C++']