Cody

Problem 42889. Should Mr McNugget even get out of bed today?

Solution 1564739

Submitted on 20 Jun 2018 by Binbin Qi
• Size: 24
• This is the leading solution.
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
nuggets = [2 5]; frob_correct = [1 3]; out_of_bed=reshape(sort(hungerGame2(nuggets)),1,[]); assert(isequal(out_of_bed,frob_correct))

2   Pass
nuggets = [6 9 20]; frob_correct = [1 2 3 4 5 7 8 10 11 13 14 16 17 19 22 23 25 28 31 34 37 43]; out_of_bed=reshape(sort(hungerGame2(nuggets)),1,[]); assert(isequal(out_of_bed,frob_correct))

3   Pass
nuggets = [17 19 32]; frob_correct = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 18 20 21 22 23 24 25 26 27 28 29 30 31 33 35 37 39 40 41 42 43 44 45 46 47 48 50 52 54 56 58 59 60 61 62 63 65 67 69 71 73 75 77 78 79 80 82 84 86 88 90 92 94 97 99 101 103 105 107 109 111 116 118 120 122 124 126 135 137 139 141 143 154 156 158 173 175]; out_of_bed=reshape(sort(hungerGame2(nuggets)),1,[]); assert(isequal(out_of_bed,frob_correct))

4   Pass
nuggets = [13 14 15]; frob_correct = [1 2 3 4 5 6 7 8 9 10 11 12 16 17 18 19 20 21 22 23 24 25 31 32 33 34 35 36 37 38 46 47 48 49 50 51 61 62 63 64 76 77]; out_of_bed=reshape(sort(hungerGame2(nuggets)),1,[]); assert(isequal(out_of_bed,frob_correct))

5   Pass
nuggets = [7 11 21]; frob_correct = [1 2 3 4 5 6 8 9 10 12 13 15 16 17 19 20 23 24 26 27 30 31 34 37 38 41 45 48 52 59]; out_of_bed=reshape(sort(hungerGame2(nuggets)),1,[]); assert(isequal(out_of_bed,frob_correct))