
想法题
haryssblog
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
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 评论 -
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 评论 -
4Sum
Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets in the array which gives the sum of target. Note: Element原创 2014-07-13 00:01:10 · 327 阅读 · 0 评论 -
Best Time to Buy and Sell Stock
Say you have an array for which the ith element is the price of a given stock on day i. If you were only permitted to complete at most one transaction (ie, buy one and sell one share of the stock),原创 2014-07-13 00:20:08 · 350 阅读 · 0 评论