chapter7-greedy-algorithm
[TOC]
贪心思想
1. 分配饼干
1 | def findContentChildren(): |
2. 不重叠的区间个数
1 | def eraseOverlapIntervals(): |
3. 投飞镖刺破气球
1 | def findMinArrowShots(): |
4. 根据身高和序号重组队列
1 | def reconstructQueue(): |
5. 买卖股票最大的收益
1 | def maxProfit(): |
6.买卖股票的最大收益 II
1 | def maxProfit2(): |
7. 种植花朵
1 | def canPlaceFlowers(): |
8. 判断是否为子序列
1 | def isSubsequence(): |
9. 修改一个数成为非递减数组
1 | def checkPossibility(): |
10. 子数组最大的和
1 | def maxSubArray(): |
11. 分隔字符串使同种字符出现在一起
1 | def partitionLabels(): |