結果 : how to create a greedy algorithm in python