Solving Array Partition I in go. Please try yourself first to solve the problem and submit your implementation to LeetCode before looking into solution.

Problem Description

Example 1:

Input: [1,4,3,2]

Output: 4
Explanation: n is 2, and the maximum sum of pairs is 4 = min(1, 2) + min(3, 4).


  1. All the integers in the array will be in the range of [-10000, 10000].

See the full details of the problem Array Partition I at LeetCode

Originally posted at: