My solution to HackerRank's version of The Bidding Game