Cody

Solution 691058

Submitted on 24 Jun 2015 by Binbin Qi
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
%% ABCD = 70; ABC = 65; AB = 40; BC = 52; y = combined_ages_nonsymmetric_w_mult(ABCD,ABC,AB,BC); y_correct = [13;27;25;5]; for i = 1:numel(y_correct) assert(isequal(y(i),y_correct(i))) end

2   Pass
%% ABCC = 98; BBC = 84; AAB = 70; y = combined_ages_nonsymmetric_w_mult(ABCC,BBC,AAB); y_correct = [20;30;24]; for i = 1:numel(y_correct) assert(isequal(y(i),y_correct(i))) end

3   Pass
%% ABCDA = 150; ABCB = 99; BCDB = 91; ABDAD = 135; y = combined_ages_nonsymmetric_w_mult(ABCDA,ABCB,BCDB,ABDAD); y_correct = [35;11;42;27]; for i = 1:numel(y_correct) assert(isequal(y(i),y_correct(i))) end

4   Pass
%% ABBA = 90; BCC = 113; ABCBA = 141; y = combined_ages_nonsymmetric_w_mult(ABBA,BCC,ABCBA); y_correct = [34;11;51]; for i = 1:numel(y_correct) assert(isequal(y(i),y_correct(i))) end

5   Pass
%% ABCDE = 120; ABCDD = 111; ABCCC = 87; ABBBB = 66; AAAAA = 50; y = combined_ages_nonsymmetric_w_mult(ABCDE,ABCDD,ABCCC,ABBBB,AAAAA); y_correct = [10,14,21,33,42]; for i = 1:numel(y_correct) assert(isequal(y(i),y_correct(i))) end

6   Pass
%% ABC = 45; BEA = 66; CAE = 73; DAB = 57; AAD = 53; y = combined_ages_nonsymmetric_w_mult(ABC,BEA,CAE,DAB,AAD); y_correct = [10,14,21,33,42]; for i = 1:numel(y_correct) assert(isequal(y(i),y_correct(i))) end

7   Pass
%% ABCABC = 144; BEAB = 107; CAEAD = 147; DABB = 73; AADAA = 133; y = combined_ages_nonsymmetric_w_mult(ABCABC,BEAB,CAEAD,DABB,AADAA); y_correct = [30,15,27,13,47]; for i = 1:numel(y_correct) assert(isequal(y(i),y_correct(i))) end

8   Pass
%% anti-cheating test case ind = randi(4); switch ind case 1 ABCC = 98; BBC = 84; AAB = 70; y = combined_ages_nonsymmetric_w_mult(ABCC,BBC,AAB); y_correct = [20;30;24]; case 2 ABCDA = 150; ABCB = 99; BCDB = 91; ABDAD = 135; y = combined_ages_nonsymmetric_w_mult(ABCDA,ABCB,BCDB,ABDAD); y_correct = [35;11;42;27]; case 3 ABCABC = 144; BEAB = 107; CAEAD = 147; DABB = 73; AADAA = 133; y = combined_ages_nonsymmetric_w_mult(ABCABC,BEAB,CAEAD,DABB,AADAA); y_correct = [30,15,27,13,47]; case 4 ABCD = 70; ABC = 65; AB = 40; BC = 52; y = combined_ages_nonsymmetric_w_mult(ABCD,ABC,AB,BC); y_correct = [13;27;25;5]; end for i = 1:numel(y_correct) assert(isequal(y(i),y_correct(i))) end

9   Pass
%% anti-cheating test case ind = randi(4); switch ind case 1 ABCC = 98; BBC = 84; AAB = 70; y = combined_ages_nonsymmetric_w_mult(ABCC,BBC,AAB); y_correct = [20;30;24]; case 2 ABCABC = 144; BEAB = 107; CAEAD = 147; DABB = 73; AADAA = 133; y = combined_ages_nonsymmetric_w_mult(ABCABC,BEAB,CAEAD,DABB,AADAA); y_correct = [30,15,27,13,47]; case 3 ABCD = 70; ABC = 65; AB = 40; BC = 52; y = combined_ages_nonsymmetric_w_mult(ABCD,ABC,AB,BC); y_correct = [13;27;25;5]; case 4 ABC = 45; BEA = 66; CAE = 73; DAB = 57; AAD = 53; y = combined_ages_nonsymmetric_w_mult(ABC,BEA,CAE,DAB,AAD); y_correct = [10,14,21,33,42]; end for i = 1:numel(y_correct) assert(isequal(y(i),y_correct(i))) end

10   Pass
%% anti-cheating test case ind = randi(4); switch ind case 1 ABBA = 90; BCC = 113; ABCBA = 141; y = combined_ages_nonsymmetric_w_mult(ABBA,BCC,ABCBA); y_correct = [34;11;51]; case 2 ABCD = 70; ABC = 65; AB = 40; BC = 52; y = combined_ages_nonsymmetric_w_mult(ABCD,ABC,AB,BC); y_correct = [13;27;25;5]; case 3 ABCDA = 150; ABCB = 99; BCDB = 91; ABDAD = 135; y = combined_ages_nonsymmetric_w_mult(ABCDA,ABCB,BCDB,ABDAD); y_correct = [35;11;42;27]; case 4 ABCC = 98; BBC = 84; AAB = 70; y = combined_ages_nonsymmetric_w_mult(ABCC,BBC,AAB); y_correct = [20;30;24]; end for i = 1:numel(y_correct) assert(isequal(y(i),y_correct(i))) end