34 贪心 Greedy

嘛,九章老师不推荐记这东西。但是呢,刷多了题,发现有些题还真得贪心才好做( ̄_, ̄ )

Greedy algorithms (来自leetcode)

Greedy problems usually look like "Find minimum number of something to do something" or "Find maximum number of something to fit in some conditions", and typically propose an unsorted input.

The idea of greedy algorithm is to pick the locally optimal move at each step, that will lead to the globally optimal solution.

134 Gas Station

1663 Smallest String With A Given Numeric Value

946 Validate Stack Sequences

452 Minimum Number of Arrows to Burst Ballons

1005 Maximize Sum Of Array After K Negations

Last updated