結果 : when to use greedy algorithm vs dynamic programming