Greedy algorithm

Greedy algorithm complete