1099. Two Sum Less Than K
Given an array A
of integers and integer K
, return the maximum S
such that there exists i < j
with A[i] + A[j] = S
and S < K
. If no i, j
exist satisfying this equation, return -1.
Example 1:
Example 2:
Note:
1 <= A.length <= 100
1 <= A[i] <= 1000
1 <= K <= 2000
Last updated
Was this helpful?