arrayPairSum optimization

Removed the inner for-loop.