https://leetcode.com/problems/array-partition-i/
| 6 | * https://leetcode.com/problems/array-partition-i/ |
| 7 | */ |
| 8 | public class Sanghoo { |
| 9 | |
| 10 | public int arrayPairSum(int[] nums) { |
| 11 | int maxSum = 0; |
| 12 | |
| 13 | Arrays.sort(nums); |
| 14 | |
| 15 | for(int i=0; i<nums.length; i+=2) { |
| 16 | maxSum += nums[i]; |
| 17 | } |
| 18 | |
| 19 | return maxSum; |
| 20 | } |
| 21 | |
| 22 | } |
nothing calls this directly
no outgoing calls
no test coverage detected