![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
贪心
haryssblog
这个作者很懒,什么都没留下…
展开
-
3Sum Closest
Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers. You may assume that each input would have exact原创 2014-07-12 23:52:12 · 253 阅读 · 0 评论 -
Two Sum && 3 Sum
Input: numbers={2, 7, 11, 15}, target=9Output: index1=1, index2=2pro:sol:原创 2014-07-12 23:34:06 · 287 阅读 · 0 评论 -
Best Time to Buy and Sell Stock II
Say you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find the maximum profit. You may complete as many transactions as you like (ie, buy on原创 2014-07-13 14:10:33 · 316 阅读 · 0 评论