Backpack Bill and Wallet Will set off for the annual festival. As they approach the stalls, Bill retorts that he'll be able to bring home more stuff than Will. Taking this as a challenge, Will refutes and a competition spurs into action.
Create a function that returns the name of the man who can bring home the most items. The parameters are given as follows:
whoWinsTonight(40, 95, 5, 10) β "Will"
// The item costs 5 coins and takes up 10 inventory spaces.
// Bill can only buy a maximum of 8 items (40 coins DIV 5 = 8).
// Will can only bring home a maximum of 9 items. (95 inventory spaces DIV 10 = 9).
// Will is the winner.
whoWinsTonight(20, 20, 5, 10) β "Bill"
whoWinsTonight(10, 2, 20, 1) β "Will"
whoWinsTonight(3, 7, 2, 5) β "Tie"
"Tie" if both men can afford the same amount of stuff.