← 返回 bytedance 的题目列表Array Partition
类型:online_judge
Given an array of even length numbers, split the numbers into two arrays (consider it pairwise), such as nums[2 * i], nums[2 * i + 1], so that the sum of all min(nums[2 * i], nums[2 * i + 1]) is maximized. Your task is to implement a function to calculate this sum.
Example
Input
1 4 3 2