Java Version of CS50 Greedy Problem Set