leetcode16

package
v0.0.0-...-a94f1ba Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 22, 2024 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Overview

* @lc app=leetcode id=16 lang=golang * * [16] 3Sum Closest * * https://leetcode.com/problems/3sum-closest/description/ * * algorithms * Medium (45.71%) * Likes: 1664 * Dislikes: 120 * Total Accepted: 426.6K * Total Submissions: 933K * Testcase Example: '[-1,2,1,-4]\n1' * * Given an array nums of n integers and an integer target, find three integers * in nums such that the sum is closest to target. Return the sum of the three * integers. You may assume that each input would have exactly one solution. * * Example: * * * Given array nums = [-1, 2, 1, -4], and target = 1. * * The sum that is closest to the target is 2. (-1 + 2 + 1 = 2). * *

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL