Cody

# Problem 1750. Modular multiplicative inverse

Solution 1984102

Submitted on 21 Oct 2019
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
X = 2; M = 1; Y = 5; y_correct = 3; assert(isequal(inverse_modulus(X,M,Y),y_correct))

Unrecognized function or variable 'x'. Error in inverse_modulus (line 2) y = x; Error in Test1 (line 5) assert(isequal(inverse_modulus(X,M,Y),y_correct))

2   Fail
X = 5; M = 1; Y = 6; y_correct = 5; assert(isequal(inverse_modulus(X,M,Y),y_correct))

Unrecognized function or variable 'x'. Error in inverse_modulus (line 2) y = x; Error in Test2 (line 5) assert(isequal(inverse_modulus(X,M,Y),y_correct))

3   Fail
X = 2; M = 1; Y = 7; y_correct = 4; assert(isequal(inverse_modulus(X,M,Y),y_correct))

Unrecognized function or variable 'x'. Error in inverse_modulus (line 2) y = x; Error in Test3 (line 5) assert(isequal(inverse_modulus(X,M,Y),y_correct))

4   Fail
X = [2 5 2]; M = [1 1 1]; Y = [5 6 7]; y_correct = [3 5 4]; assert(isequal(inverse_modulus(X,M,Y),y_correct))

Unrecognized function or variable 'x'. Error in inverse_modulus (line 2) y = x; Error in Test4 (line 5) assert(isequal(inverse_modulus(X,M,Y),y_correct))

5   Fail
X = 3; M = 1; Y = 11; y_correct = 4; assert(isequal(inverse_modulus(X,M,Y),y_correct))

Unrecognized function or variable 'x'. Error in inverse_modulus (line 2) y = x; Error in Test5 (line 5) assert(isequal(inverse_modulus(X,M,Y),y_correct))

6   Fail
X = 3; M = 2; Y = 11; y_correct = 8; assert(isequal(inverse_modulus(X,M,Y),y_correct))

Unrecognized function or variable 'x'. Error in inverse_modulus (line 2) y = x; Error in Test6 (line 5) assert(isequal(inverse_modulus(X,M,Y),y_correct))

7   Fail
X = [3 5 7]; M = [1 2 3]; Y = [5 6 13]; y_correct = [2 4 6]; assert(isequal(inverse_modulus(X,M,Y),y_correct))

Unrecognized function or variable 'x'. Error in inverse_modulus (line 2) y = x; Error in Test7 (line 5) assert(isequal(inverse_modulus(X,M,Y),y_correct))