Cody

Solution 854479

Submitted on 22 Mar 2016 by Jean-Marie Sainthillier
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
V1 = [2 3] ; V2 = [1 2];; y_correct = 5; assert(isequal(leftovers(V1,V2),y_correct))

2   Pass
V1=[3 5 7] ; V2=[1 2 3]; y_correct = 52; assert(isequal(leftovers(V1,V2),y_correct))

3   Pass
V1=[3 4 5] ; V2=[2 3 1]; y_correct = 11; assert(isequal(leftovers(V1,V2),y_correct))

4   Pass
V1=[4 9 25] ; V2=[3 2 7]; y_correct = 407; assert(isequal(leftovers(V1,V2),y_correct))

5   Pass
V1=[9 10 77] ; V2=[1 2 69]; y_correct = 6922; assert(isequal(leftovers(V1,V2),y_correct))

6   Pass
a=primes(30); b=ceil(8*rand()+2) V1=a(1:b);V2=1:b; y_correct=[23 53 1523 29243 299513 4383593 188677703 5765999453]; assert(isequal(leftovers(V1,V2),y_correct(b-2)))

b = 4

7   Pass
V1=[leftovers([6 35],[3 9]) leftovers([3 5 7],[1 3 1])]; assert(isequal(leftovers(V1,V1-8),379))

8   Pass
% Discourage the for x=1:inf loops V1=[74 93 145 161 209 221]; V2=[66 85 137 153 201 213]; y_correct=7420738134802; assert(isequal(leftovers(V1,V2),y_correct))

9   Pass
% Discourage the for x=1:inf loops V1=[17 82 111 155 203 247 253] ; V2=[11 50 68 95 124 150 154]; y_correct=59652745309190; assert(isequal(leftovers(V1,V2),y_correct))