Very Easy SOlution
\n# Code\n\nclass Solution {\npublic:\n    bool checkZ(vector<int> arr) {\n        for (int i = 0; i < arr.size(); i++) {\n            if (arr[i] == 0) {\n     
\n# Code\n```\nclass Solution {\npublic:\n    bool checkZ(vector<int> arr) {\n        for (int i = 0; i < arr.size(); i++) {\n            if (arr[i] == 0) {\n                return true;\n            }\n        }\n        return false;\n    }\n\n    long long Sum(vector<int> arr) {\n        long long sum = 0;\n\n        for (int i = 0; i < arr.size(); i++) {\n            sum = sum + arr[i];\n        }\n        return sum;\n    }\n    long long minSum(vector<int>& nums1, vector<int>& nums2) {\n\n        bool check1 = false;\n        bool check2 = false;\n\n        if (checkZ(nums1)) {\n            check1 = true;\n        }\n        if (checkZ(nums2)) {\n            check2 = true;\n        }\n        long long sum1 = Sum(nums1);\n        long long sum2 = Sum(nums2);\n\n        long total = 0;\n          \n        if( check1 == false && check2 == false){\n            if( sum1 != sum2){\n                return -1;\n            }else{\n                return sum1;\n            }\n              \n        }\n         else if (check1 == true && check2 == true) {\n            for (int i = 0; i < nums1.size(); i++) {\n                if (nums1[i] == 0) {\n                    nums1[i] = 1;\n                }\n            }\n            for (int i = 0; i < nums2.size(); i++) {\n                if (nums2[i] == 0) {\n                    nums2[i] = 1;\n                }\n            }\n\n            sum1 = Sum(nums1);\n            sum2 = Sum(nums2);\n\n            if (sum1 > sum2) {\n                total = sum1 - sum2;\n                for (int i = 0; i < nums2.size(); i++) {\n                    if (nums2[i] == 1) {\n                        nums2[i] = total + 1;\n                        sum2 = Sum(nums2);\n                        return sum2;\n                        break;\n                    }\n                }\n            } else if (sum1 < sum2) {\n                total = sum2 - sum1;\n                for (int i = 0; i < nums1.size(); i++) {\n                    if (nums1[i] == 1) {\n                        nums1[i] = total + 1;\n                        sum1 = Sum(nums1);\n                        return sum1;\n                        break;\n                    }\n                }\n            }\n            else if(sum1 ==sum2){\n                return sum1;\n            }\n        }\n        \n        else if (check1 == true) {\n            for (int i = 0; i < nums1.size(); i++) {\n                if (nums1[i] == 0) {\n                    nums1[i] = 1;\n                }\n            }\n            sum1 = Sum(nums1);\n            if (sum1 > sum2) {\n                return -1;\n            }\n            else if(sum1 < sum2){\n                total = sum2 -sum1;\n                for (int i = 0; i < nums1.size(); i++) {\n                    if (nums1[i] == 1) {\n                        nums1[i] = total + 1;\n                        sum2 = Sum(nums2);\n                        return sum2;\n                        break;\n                    }\n                }\n            }\n            else if(sum1 ==sum2){\n                return sum1;\n            }\n        } \n        else if (check2 == true) {\n            for (int i = 0; i < nums2.size(); i++) {\n                if (nums2[i] == 0) {\n                    nums2[i] = 1;\n                }\n            }\n            sum2 = Sum(nums2);\n            if (sum1 < sum2) {\n                return -1;\n            }\n            else if(sum1 > sum2){\n                total = sum1 -sum2;\n                for (int i = 0; i < nums2.size(); i++) {\n                    if (nums2[i] == 1) {\n                        nums2[i] = total + 1;\n                        sum1 = Sum(nums1);\n                        return sum1;\n                        break;\n                    }\n                }\n            }\n            else if(sum1 ==sum2){\n                return sum1;\n            }\n        }\n    return -1;\n        // else if (check1 == true && check2 == true) {\n        //     for (int i = 0; i < nums1.size(); i++) {\n        //         if (nums1[i] == 0) {\n        //             nums1[i] = 1;\n        //         }\n        //     }\n        //     for (int i = 0; i < nums2.size(); i++) {\n        //         if (nums2[i] == 0) {\n        //             nums2[i] = 1;\n        //         }\n        //     }\n\n        //     sum1 = Sum(nums1);\n        //     sum2 = Sum(nums2);\n\n        //     if (sum1 > sum2) {\n        //         total = sum1 - sum2;\n        //         for (int i = 0; i < nums2.size(); i++) {\n        //             if (nums2[i] == 1) {\n        //                 nums2[i] = total + 1;\n        //                 sum2 = Sum(nums2);\n        //                 return sum2;\n        //                 break;\n        //             }\n        //         }\n        //     } else if (sum1 < sum2) {\n        //         total = sum2 - sum1;\n        //         for (int i = 0; i < nums1.size(); i++) {\n        //             if (nums1[i] == 1) {\n        //                 nums1[i] = total + 1;\n        //                 sum1 = Sum(nums1);\n        //                 return sum1;\n        //                 break;\n        //             }\n        //         }\n        //     }\n        // }\n    }\n};\n\n```
['C++']