Leetcode-Greedy Algorithms Problems

Posted by Xiaoye's Blog on March 26, 2020

Introduction

Greedy algorithm is an algorithm that

  1. computes the solution in steps
  2. at each step, it makes decision that is locally optimum

The greedy algorithm does not necessarily produce the optimum solution.

Problem

Leetcode problems:

  1. 455 assign cookies
  2. 452 minimum number of arrows to burst balloons
  3. 122 best time to buy and sell stock II
  4. 605 can place flowers