给定一个整数数组的2n个整数,将这些整数分成n对 (a1,b1), (a2,b2),..., (an, bn),使所有i的min(ai,bi) 的总和最大化.返回最大化总和.
To maximize the sum of minimums, we should try to pair up the numbers so that the difference between the pairs is as small as possible. So, we can sort the array and then pair up the numbers in consecutive pairs, which guarantees that the difference between the pairs is at most 1 (since the array has an even length).

Then, we can add up the minimum of each pair to obtain the maximum possible sum of minimums. This can be done using a loop that iterates over the array and adds up every other value from the sorted array.

Here is some code to implement this:

```
def arrayPairSum(nums):
    nums.sort()
    return sum(nums[::2])
```

This function takes an input array `nums`, sorts it, and then returns the sum of every other element of the sorted array.