Easiest solution || Beginners Friendly || C++
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 {\npublic:\n    long long minSum(vector<int>& nums1, vector<int>& nums2) {\n        long long sum1=accumulate(nums1.begin(),nums1.end(),1LL*0);\n        long long sum2=accumulate(nums2.begin(),nums2.end(),1LL*0);\n        int z1=0,z2=0;\n        for(int i=0;i<nums1.size();i++){\n            if(nums1[i]==0) z1++;\n        }\n        for(int i=0;i<nums2.size();i++){\n            if(nums2[i]==0) z2++;\n        }\n         if(sum1==sum2 &&( z1==0 && z2==0)){\n            return sum1;\n        }\n        if(sum1==sum2 &&( z1!=0 && z2!=0)){\n            return sum1+max(z1,z2);\n        }\n        cout<<sum1<<" "<<z1<<endl;\n        cout<<sum2<<" "<<z2<<endl;\n        // return (sum1+z1<=sum2+z2)?sum2+z2:-1;\n        if(sum1+z1 <=sum2+z2 && z1!=0){\n            return sum2+z2;\n        }\n        else if(sum2+z2<= sum1+z1 && z2!=0){\n            return sum1+z1;\n        }\n        return -1;\n    }\n};\n```
['C++']