
贪婪算法
文章平均质量分 50
back-to-back
忙忙碌碌终日,终于一事无成。
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
LeetCode 之 Container With Most Water
Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i, 0). Fin原创 2016-03-17 10:02:41 · 238 阅读 · 0 评论 -
LeetCode 之 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原创 2016-01-14 22:01:12 · 290 阅读 · 0 评论