Easy Solution for beginners  | Cpp | Greedy
Code\n\nclass Solution {\npublic:\n    long long minSum(vector<int>& nums1, vector<int>& nums2) {\n        long long  sum1 = 0, sum2=0;\n        long long zero1
# Code\n```\nclass Solution {\npublic:\n    long long minSum(vector<int>& nums1, vector<int>& nums2) {\n        long long  sum1 = 0, sum2=0;\n        long long zero1= 0, zero2 = 0;\n\n        for(int i:nums1){\n            if(i==0){\n                zero1++;\n            }\n            sum1+=(long)i;\n        }\n        for(int i:nums2){\n            if(i==0){\n                zero2++;\n            }\n            sum2+=(long)i;\n        }\n\n        sum1+=zero1;\n        sum2+=zero2;\n\n        if((sum1<sum2 && zero1==0) || (sum2<sum1 && zero2==0)){\n            return -1;\n        }\n\n        return max(sum1,sum2);    \n    }\n};\n```
['Greedy', 'C++']