本文準備講解1個簡單的算法編程問題感猛, 這個算法編程問題來自LintCode平臺邪狞。不了解.LintCode平臺的讀者可以閱讀筆者文章(在線編程平臺推薦-LeetCode)玩郊。問題的英文版本描述如下:
Sum
Find three. ?The sum is the closest for a target. Return the sum .
Example
For example,?[-1 2 1 -4], the target is1. 2.?(-1 + 2 + 1 = 2).
和
Find three. ?The sum is the closest for a target. Return the sum .
Example
For example,?[-1 2 1 -4], the target is1. 2.(-1 + 2 + 1 = 2).
介紹1種簡單高效的算法。
簡單高效的算法