Cody

Problem 1672. Leftovers? Again?!

Solution 2944483

Submitted on 13 Sep 2020
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

This solution is outdated. To rescore this solution, sign in.

Test Suite

Test Status Code Input and Output
1   Fail
V1 = [2 3] ; V2 = [1 2];; y_correct = 5; assert(isequal(leftovers(V1,V2),y_correct))

Error using builtin Unrecognized function or variable 'solutionTest'.

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

Error using builtin Unrecognized function or variable 'solutionTest'.

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

Error using builtin Unrecognized function or variable 'solutionTest'.

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

Error using builtin Unrecognized function or variable 'solutionTest'.

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

Error using builtin Unrecognized function or variable 'solutionTest'.

6   Fail
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)))

Error using builtin Unrecognized function or variable 'solutionTest'.

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

Error using builtin Unrecognized function or variable 'solutionTest'.

8   Fail
% 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))

Error using builtin Unrecognized function or variable 'solutionTest'.

9   Fail
% 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))

Error using builtin Unrecognized function or variable 'solutionTest'.

Suggested Problems

More from this Author80

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!