結果 : greedy method time complexity