C #Solution.


  • 0
    F

    '''
    public class Solution {
    public int ArrayPairSum(int[] nums)
    {
    Array.Sort(nums);
    int sum = 0;
    for(int i = 0; i<nums.Length; i+=2)
    {
    sum+=Math.Min(nums[i],nums[i+1]);
    }

        return sum;
    }
    

    }'''


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.