This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.
Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
x = [0,1,2,3,4];
y_correct = [4,3,2,1,0];
assert(isequal(desSort(x),y_correct))
r =
5
p =
0
p =
1
x =
0 0 2 3 4
x =
1 0 2 3 4
p =
2
x =
1 0 1 3 4
x =
2 0 1 3 4
p =
1
x =
2 0 0 3 4
x =
2 1 0 3 4
p =
3
x =
2 1 0 2 4
x =
3 1 0 2 4
p =
2
x =
3 1 0 1 4
x =
3 2 0 1 4
p =
1
x =
3 2 0 0 4
x =
3 2 1 0 4
p =
4
x =
3 2 1 0 3
x =
4 2 1 0 3
p =
3
x =
4 2 1 0 2
x =
4 3 1 0 2
p =
2
x =
4 3 1 0 1
x =
4 3 2 0 1
p =
1
x =
4 3 2 0 0
x =
4 3 2 1 0
y =
4 3 2 1 0
|
312 Solvers
316 Solvers
How long is the longest prime diagonal?
338 Solvers
Vectorize the digits of an Integer
269 Solvers
364 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!