Cody

# Problem 43652. "Bubblegum, Bubblegum, in a dish; How many pieces do you wish?"

Solution 1673102

Submitted on 13 Nov 2018 by Binbin Qi
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Pass
players=4; wishes=[3 5 1 6 3 2 4]; winner=2; assert(isequal(bbgwinner(players, wishes),winner))

2   Pass
players=4; wishes=[20 13 7 8 2 16 3]; winner=4; assert(isequal(bbgwinner(players, wishes),winner))

3   Pass
players=2 wishes=[2 1]; winner=2; assert(isequal(bbgwinner(players, wishes),winner))

players = 2

4   Pass
players=5; wishes=[20 13 7 8 2 16 3 1 2]; winner=4; assert(isequal(bbgwinner(players, wishes),winner))

5   Pass
players=5; wishes=[20 13 7 8 2 16 3 3]; winner=5; assert(isequal(bbgwinner(players, wishes),winner))

6   Pass
players=20; wishes=123.*[1:39]; winner=17 assert(isequal(bbgwinner(players, wishes),winner))

winner = 17

7   Pass
players=30; wishes=[1:59]; winner=18; assert(isequal(bbgwinner(players, wishes),winner))

8   Pass
players=30; wishes=[1:54 3 1 2 4]; winner=29; assert(isequal(bbgwinner(players, wishes),winner)) %%