Cody

Problem 45508. AK Sorting according to given order

Solution 2271746

Submitted on 11 May 2020 by Nikolaos Nikolaou
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
a = [ 3 8 7 5 0 9 2 1 6 4]; b= [ 2 4 5 5 3 3 3 9 0]; c_correct =[3,3,3,5,5,0,9,2,4]; assert(isequal(ak_sorting(a,b),c_correct))

c = 3 3 3 c = 3 3 3 c = 3 3 3 c = 3 3 3 5 5 c = 3 3 3 5 5 0 c = 3 3 3 5 5 0 9 c = 3 3 3 5 5 0 9 2 c = 3 3 3 5 5 0 9 2 c = 3 3 3 5 5 0 9 2 c = 3 3 3 5 5 0 9 2 4

2   Pass
a = [ 0 1 2 3 4 5 6 7 8 9]; b= [ 5 6 7 3 5 1 9 0 5 6 7 8 2 4 5]; c_correct = [0 1 2 3 4 5 5 5 5 6 6 7 7 8 9]; assert(isequal(ak_sorting(a,b),c_correct))

c = 0 c = 0 1 c = 0 1 2 c = 0 1 2 3 c = 0 1 2 3 4 c = 0 1 2 3 4 5 5 5 5 c = 0 1 2 3 4 5 5 5 5 6 6 c = 0 1 2 3 4 5 5 5 5 6 6 7 7 c = 0 1 2 3 4 5 5 5 5 6 6 7 7 8 c = 0 1 2 3 4 5 5 5 5 6 6 7 7 8 9

3   Pass
a = [ 9 8 7 6 5 4 3 2 1 0]; b= [3 4 1 2 3 4 1 2 3 4 1 2]; c_correct = [4 4 4 3 3 3 2 2 2 1 1 1]; assert(isequal(ak_sorting(a,b),c_correct))

c = 1×0 empty double row vector c = 1×0 empty double row vector c = 1×0 empty double row vector c = 1×0 empty double row vector c = 1×0 empty double row vector c = 4 4 4 c = 4 4 4 3 3 3 c = 4 4 4 3 3 3 2 2 2 c = 4 4 4 3 3 3 2 2 2 1 1 1 c = 4 4 4 3 3 3 2 2 2 1 1 1

4   Pass
a = [4 5 7 8 0 3 1 2 9 6]; b= [5 4 3 8 7 6 5 4 3 5 3 2 1 0 9 1]; c_correct = [4 4 5 5 5 7 8 0 3 3 3 1 1 2 9 6]; assert(isequal(ak_sorting(a,b),c_correct))

c = 4 4 c = 4 4 5 5 5 c = 4 4 5 5 5 7 c = 4 4 5 5 5 7 8 c = 4 4 5 5 5 7 8 0 c = 4 4 5 5 5 7 8 0 3 3 3 c = 4 4 5 5 5 7 8 0 3 3 3 1 1 c = 4 4 5 5 5 7 8 0 3 3 3 1 1 2 c = 4 4 5 5 5 7 8 0 3 3 3 1 1 2 9 c = 4 4 5 5 5 7 8 0 3 3 3 1 1 2 9 6