Cody

Problem 44762. Find The Difference

Solution 2673221

Submitted on 9 Jul 2020 by Ramesh Kumar V
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 =[ 3 2 2 3 6 9 8 4]; dif_correct =76308633; assert(isequal(difference(x),dif_correct))

2   Pass
x =[ 3 2 2 0 0 4]; dif_correct =429966; assert(isequal(difference(x),dif_correct))

3   Pass
x =[1 1 1]; dif_correct = 0; assert(isequal(difference(x),dif_correct))

4   Pass
x =[1 2 3 3 2 1]; dif_correct = 219978; assert(isequal(difference(x),dif_correct))

Suggested Problems

More from this Author1