← 返回 meta 的题目列表Find Pair with Sum Closest to Target
类型:online_judge
Given an ascending sorted integer array array and a target value target, find the pair of numbers from the array whose sum is closest to the target value. If there are multiple solutions, return any one of them. Implement an efficient algorithm. Consider cases where the target is very large/small and the array is not sorted.
Example
Input
10
1 2 4 5 7 11 15