Cody

Problem 42888. Frobenius McNugget Factorization

Solution 2975908

Submitted on 21 Sep 2020
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
nuggets = [2 5]; frob_correct = 3; assert(isequal(hungerGame(nuggets),frob_correct))

Index exceeds the number of array elements (2). Error in hungerGame (line 9) n = mod(n, nuggets(i)); Error in Test1 (line 3) assert(isequal(hungerGame(nuggets),frob_correct))

2   Fail
nuggets = [6 9 20]; frob_correct = 43; assert(isequal(hungerGame(nuggets),frob_correct))

Index exceeds the number of array elements (3). Error in hungerGame (line 9) n = mod(n, nuggets(i)); Error in Test2 (line 3) assert(isequal(hungerGame(nuggets),frob_correct))

3   Fail
nuggets = [17 19 32]; frob_correct = 175; assert(isequal(hungerGame(nuggets),frob_correct))

Index exceeds the number of array elements (3). Error in hungerGame (line 9) n = mod(n, nuggets(i)); Error in Test3 (line 3) assert(isequal(hungerGame(nuggets),frob_correct))

4   Fail
nuggets = [13 14 15]; frob_correct = 77; assert(isequal(hungerGame(nuggets),frob_correct))

Index exceeds the number of array elements (3). Error in hungerGame (line 9) n = mod(n, nuggets(i)); Error in Test4 (line 3) assert(isequal(hungerGame(nuggets),frob_correct))

Suggested Problems

More from this Author50

Community Treasure Hunt

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

Start Hunting!