Greedy Algorithm and Code challenge