Skip to content

3Sum Closest #14

@barretlee

Description

@barretlee

本题难度:★★

给定一个长度为 n 整数数组 S,找出三个整数,使得三数之和最接近给定的一个目标数 target,返回这三数之和。

假定给定的 S 只有一个解,例如:

给定 S = [-1, 2, 1, -4], target = 1,与 target 最接近的三数和为 (-1 + 2 + 1 = 2),输出 2.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions