取较小的一位。
function arrayPairSum(nums: number[]): number { return nums.sort((a, b) => a - b).reduce((acc, n, i) => acc + (i % 2 === 0 ? n : 0), 0) }