less than 1 minute read

You are given a list of integers nums and an integer target. Return the lowest sum of pair of numbers that is greater than target. You can assume that a solution exists.

Constraints

  • 2 ≤ n ≤ 100,000 where n is the length of nums

https://binarysearch.com/problems/Lowest-Sum-of-Pair-Larger-than-Target

Examples

Example 1

Input

  • nums = [1, 3, 5, 9, 13]
  • target = 8

Output

  • answer = 10

Explanation

We pick 1 and 9

Solution

Leave a comment