Cody

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

Solution 1114817

Submitted on 2 Feb 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))

f = 1 1 2 2 3 3

Assertion failed.

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

f = Columns 1 through 16 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 Columns 17 through 32 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 Columns 33 through 40 17 17 18 18 19 19 20 20

Assertion failed.

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

players = 2 f = 1 1 2 2

Assertion failed.

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

f = Columns 1 through 16 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 Columns 17 through 32 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 Columns 33 through 40 17 17 18 18 19 19 20 20

Assertion failed.

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

f = Columns 1 through 16 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 Columns 17 through 32 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 Columns 33 through 40 17 17 18 18 19 19 20 20

Assertion failed.

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

winner = 17 f = Columns 1 through 16 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 Columns 17 through 32 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 Columns 33 through 48 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 Columns 49 through 64 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 Columns 65 through 80 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 Columns 81 through 96 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 Columns 97 through 112 49 49 50 50 51 51 52 52 53 53 54 54 55 55 56 56 Columns 113 through 128 57 57 58 58 59 59 60 60 61 61 62 62 63 63 64 64 Columns 129 through 144 65 65 66 66 67 67 68 68 69 69 70 70 71 71 72 72 Columns 145 through 160 73 73 74 74 75 75 76 76 77 77 78 78 79 79 80 80 Columns 161 through 176 81 81 82 82 83 83 84 84 85 85 86 86 87 87 88 88 Columns 177 through 192 89 89 90 90 91 91 92 92 93 93 94 94 95 95 96 96 Columns 193 through 208 97 97 98 98 99 99 100 100 101 101 102 102 103 103 104 104 Columns 209 through 224 105 105 106 106 107 107 108 108 109 109 110 110 111 111 112 112 Columns 225 through 240 113 113 114 114 115 115 116 116 117 117 118 118 119 119 120 120 Columns 241 through 246 121 121 122 122 123 123

Assertion failed.

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

f = 1 1

Assertion failed.

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

f = 1 1

Assertion failed.

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!