
贪心
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 · 292 阅读 · 0 评论 -
Two Sum && 3 Sum
Input: numbers={2, 7, 11, 15}, target=9 Output: index1=1, index2=2 pro: sol:原创 2014-07-12 23:34:06 · 327 阅读 · 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 · 353 阅读 · 0 评论