It's An Easy Math Question
IntuitionBe careful of the data size.ApproachComplexity
Time complexity:

Space complexity:
Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->
Be careful of the data size.
# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```csharp []
public class Solution {
    public long MinSum(int[] nums1, int[] nums2) {
        long sum1 = 0, zero1 = 0, sum2 = 0, zero2 = 0;
        foreach(int n in nums1)
        {
            if(n == 0)
                zero1++;
            else
                sum1 += n;
        }

        foreach(int n in nums2)
        {
            if(n == 0)
                zero2++;
            else
                sum2 += n;
        }

        if(zero1 == 0 && zero2 == 0)
            return sum1 == sum2 ? sum1 : -1;
        else if(zero1 != 0 && zero2 != 0)
            return Math.Max(sum1+zero1, sum2+zero2);
        else
        {
            if(zero1 == 0 && sum1 < sum2+zero2 || zero2 == 0 && sum2 < sum1+zero1)
                return -1;

            return zero1 == 0 ? sum1 : sum2;
        }
    }
}
```
['C#']