Given integer X, determine if 2 elements of array have X as sum

Checking in O(N logN), O(1) [Time, Space] solution.