java solution array-pair-sum