1099. Two Sum Less Than K
ArrayTwo PointersBinary SearchSorting
Hints
Hint 1
What if we have the array sorted?
Hint 2
Loop the array and get the value A[i] then we need to find a value A[j] such that A[i] + A[j] < K which means A[j] < K - A[i]. In order to do that we can find that value with a binary search.
Preparing judge…