Cody

Problem 2818. Remove and Sort

Solution 3137881

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

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

2   Pass
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 19 14 23 20 17 11 2 7 5 9 25 15 6 10 21 3 1 16 18 24 22 8 4 12 x = 2 4 6 8 10 12 14 16 18 20 22 24

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!