Cody

Problem 2818. Remove and Sort

Solution 3805288

Submitted on 23 Nov 2020
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   Fail
n=10 x = randperm(n); y_correct = [2 4 6 8 10]; assert(isequal(rmv_srt(n),y_correct))

n = 10 x = 6 4 9 7 10 1 3 8 5 2 y = 1 2 3 4 5 6 7 8 10 y = 1 2 3 4 5 6 8 10 y = 1 2 3 4 6 8 10 y = 1 2 4 6 8 10 y = 2 4 6 8 10

Assertion failed.

2   Fail
n=25 x = randperm(n); y_correct = [2 4 6 8 10 12 14 16 18 20 22 24]; assert(isequal(rmv_srt(n),y_correct))

n = 25 x = 13 8 20 6 3 11 19 9 4 1 24 25 22 12 7 10 21 18 16 2 5 17 23 15 14 y = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 y = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 24 y = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 22 24 y = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 20 22 24 y = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 18 20 22 24 y = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 16 18 20 22 24 y = 1 2 3 4 5 6 7 8 9 10 11 12 14 16 18 20 22 24 y = 1 2 3 4 5 6 7 8 9 10 12 14 16 18 20 22 24 y = 1 2 3 4 5 6 7 8 10 12 14 16 18 20 22 24 y = 1 2 3 4 5 6 8 10 12 14 16 18 20 22 24 y = 1 2 3 4 6 8 10 12 14 16 18 20 22 24 y = 1 2 4 6 8 10 12 14 16 18 20 22 24 y = 2 4 6 8 10 12 14 16 18 20 22 24

Assertion failed.

Suggested Problems

More from this Author8

Community Treasure Hunt

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

Start Hunting!