Cody

Problem 1018. Array GCD

Solution 2799544

Submitted on 6 Aug 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
a = [45 15 200 300]; arraygcdok=5; assert(isequal(arraygcd(a),arraygcdok))

thegcd = 1 thegcd = 1 thegcd = 1 thegcd = 1

Assertion failed.

2   Fail
a = [140 7 14 35 42]; arraygcdok=7; assert(isequal(arraygcd(a),arraygcdok))

thegcd = 1 thegcd = 1 thegcd = 1 thegcd = 1 thegcd = 1

Assertion failed.

3   Fail
a = [100 90 70 2000]; arraygcdok=10; assert(isequal(arraygcd(a),arraygcdok))

thegcd = 1 thegcd = 1 thegcd = 1 thegcd = 1

Assertion failed.