<commit_before>package leetcode;

/**
 * https://leetcode.com/problems/array-partition-i
 */
public class Problem561 {
    public int arrayPairSum(int[] nums) {
        // TODO
        return 0;
    }

    public static void main(String[] args) {
        Problem561 prob = new Problem561();
        System.out.println(prob.arrayPairSum(new int[]{1, 4, 3, 2})); // 4
    }
}<commit_msg>Solve problem 561<commit_after>package leetcode;

import java.util.Arrays;

/**
 * https://leetcode.com/problems/array-partition-i
 */
public class Problem561 {
    public int arrayPairSum(int[] nums) {
        Arrays.sort(nums);
        int i = 0;
        int sum = 0;
        while (i < nums.length) {
            sum += Math.min(nums[i], nums[i + 1]);
            i += 2;
        }
        return sum;
    }
}
{'fraction_non_alphanumeric': 0.14429109159347553, 'fraction_numerical': 0.03136762860727729, 'mean_word_length': 2.1666666666666665, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3001636', 'n_tokens_mistral': 290, 'n_tokens_neox': 265, 'n_words': 60}