CS50 problem set 1 - greedy.c