Cody

Solution 851049

Submitted on 15 Mar 2016 by James
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
x = [1 10 13 50 26]; y_correct = 13; assert(isequal(greatest_gcm(x),y_correct))

nx = 1 2 1 3 1 4 1 5 2 3 2 4 2 5 3 4 3 5 4 5 k = 1 k = 1 k = 1 k = 1 k = 1 k = 10 k = 10 k = 10 k = 13 k = 13

2   Pass
x = [1 1 1 2 5]; y_correct = 1; assert(isequal(greatest_gcm(x),y_correct))

nx = 1 2 1 3 1 4 1 5 2 3 2 4 2 5 3 4 3 5 4 5 k = 1 k = 1 k = 1 k = 1 k = 1 k = 1 k = 1 k = 1 k = 1 k = 1

3   Pass
x =[25 50 1 5 1 2 4 5]; y_correct = 25; assert(isequal(greatest_gcm(x),y_correct))

nx = 1 2 1 3 1 4 1 5 1 6 1 7 1 8 2 3 2 4 2 5 2 6 2 7 2 8 3 4 3 5 3 6 3 7 3 8 4 5 4 6 4 7 4 8 5 6 5 7 5 8 6 7 6 8 7 8 k = 25 k = 25 k = 25 k = 25 k = 25 k = 25 k = 25 k = 25 k = 25 k = 25 k = 25 k = 25 k = 25 k = 25 k = 25 k = 25 k = 25 k = 25 k = 25 k = 25 k = 25 k = 25 k = 25 k = 25 k = 25 k = 25 k = 25 k = 25