python solution to Array Pair Sum in O(n)