🚨 C++ || 100% Faster || Simple 3 path
Intuition\n- We count the sum and number of zero for both array\n- After sorting, if we need to add a value in the array with greater sum and the other array ha
**Intuition**\n- We count the sum and number of zero for both array\n- After sorting, if we need to add a value in the array with greater sum and the other array has no zero return -1\n- If the difference between is less than the zero_count of other array and left array has no zero_count, we return -1\n- Otherwise the max value of sum of sum and zero count between both array is the answer\n\n**Code**\n```c++\nlong long minSum(vector<int>& l, vector<int>& r) {\n    long long sum_l = 0, sum_r = 0, zero_l = 0, zero_r = 0;\n    for (auto i: l) if (i) sum_l += i; else zero_l++;\n    for (auto i: r) if (i) sum_r += i; else zero_r++;\n    \n    if (sum_l < sum_r || (sum_l == sum_r && zero_l > zero_r)) \n        swap(sum_l, sum_r), swap(zero_l, zero_r);\n    \n    auto need = sum_l - sum_r;\n    if (need && !zero_r) return -1;\n    else if (need < zero_r && !zero_l) return -1;\n    \n    return max(sum_l + zero_l, sum_r + zero_r);\n}\n```\n\n**For more solutions and concepts, check out this \uD83D\uDCD6 [BLOG](https://github.com/MuhtasimTanmoy/notebook)  and  \uD83C\uDFC6 [GITHUB REPOSITORY](https://github.com/MuhtasimTanmoy/playground) with over 2000+ solutions.**
[]