Java 97.77% simple solution
Code\njava []\nclass Solution {\n    public long minSum(int[] nums1, int[] nums2) {\n        long s1=0,s2=0;\n        int c1=0,c2=0;\n        for(int i=0;i<nums
# Code\n```java []\nclass Solution {\n    public long minSum(int[] nums1, int[] nums2) {\n        long s1=0,s2=0;\n        int c1=0,c2=0;\n        for(int i=0;i<nums1.length;i++){\n            if(nums1[i]==0){\n                c1++;\n                s1+=1;\n            }\n            else\n            s1+=nums1[i];\n        }\n        for(int j=0;j<nums2.length;j++){\n            if(nums2[j]==0){\n                c2++;\n                s2+=1;\n            }\n            else\n            s2+=nums2[j];\n        }\n        if(s1==s2)return s1;\n        if(s1>s2){\n            if(c2!=0){\n                return s1;\n            }\n        }\n        else{\n            if(c1!=0){\n                return s2;\n            }\n        }\n        return -1;\n    }\n}\n```
['Java']