結果 : greedy algorithm code