Cody

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

Solution 1260718

Submitted on 2 Sep 2017
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   Fail
players=4; wishes=[3 5 1 6 3 2 4]; winner=2; assert(isequal(bbgwinner(players, wishes),winner))

Index exceeds matrix dimensions. Error in bbgwinner (line 4) circshift(ans,-14-wishes(1)); Error in Test1 (line 4) assert(isequal(bbgwinner(players, wishes),winner))

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

Index exceeds matrix dimensions. Error in bbgwinner (line 4) circshift(ans,-14-wishes(1)); Error in Test2 (line 4) assert(isequal(bbgwinner(players, wishes),winner))

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

players = 2

Index exceeds matrix dimensions. Error in bbgwinner (line 4) circshift(ans,-14-wishes(1)); Error in Test3 (line 4) assert(isequal(bbgwinner(players, wishes),winner))

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

Index exceeds matrix dimensions. Error in bbgwinner (line 4) circshift(ans,-14-wishes(1)); Error in Test4 (line 4) assert(isequal(bbgwinner(players, wishes),winner))

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

Index exceeds matrix dimensions. Error in bbgwinner (line 4) circshift(ans,-14-wishes(1)); Error in Test5 (line 4) assert(isequal(bbgwinner(players, wishes),winner))

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

winner = 17

Index exceeds matrix dimensions. Error in bbgwinner (line 4) circshift(ans,-14-wishes(1)); Error in Test6 (line 4) assert(isequal(bbgwinner(players, wishes),winner))

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

Assertion failed.

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

Assertion failed.