Let us consider the array is sorted in increasing Order.
The sum of last two elements is maximum.
Example.
50 70 71 100 200 250
Sum of last two elements 200 +250 = 450.
There is no any other pair of elements(a,b), whose sum is > 450 So a+b<450
So we can say if sum of last two elements is not more than 1000 , there is no pair of elements whose sum is >1000.
otherwise we can say there is a pair of elements (a,b) where SUM(a,b)>1000
Example.
50 70 71 100 200 950
Sum of last two elements 200 +950 = 1150.
200,950 is a pair of two elements whose sum is >1000.
Let us consider the array is sorted in decreasing Order. The sum of first two elements is maximum.
Applying the Same logic, we get the pair of elements.
Time Complexity = Accessing first two elements(a,b) + Add them + Check SUM(a,b) >1000 +
Accessing Last two elements(d,e) + Add them + Check SUM(d,e) >1000
Time Complexity = O(1).
Correct me if I am wrong.