1The algorithm basically uses the fact that the input array is
2sorted. We start the sum of extreme values (smallest and
3largest) and conditionally move both pointers. We move left
4pointer i when the sum of A[i] and A[j] is less than X. We
5do not miss any pair because the sum is already smaller than X.
6Same logic applies for right pointer j.