Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
x = 1:5;
for spatula = sort_pancakes(x)
x(1:spatula) = flip(x(1:spatula));
end
assert(issorted(x))
|
2 | Pass |
x = [6 4 2 5 3 1];
for spatula = sort_pancakes(x)
x(1:spatula) = flip(x(1:spatula));
end
assert(issorted(x))
|
3 | Pass |
x = randperm(12);
for spatula = sort_pancakes(x)
x(1:spatula) = flip(x(1:spatula));
end
assert(issorted(x))
|
4 | Pass |
x = randperm(13);
for spatula = sort_pancakes(x)
x(1:spatula) = flip(x(1:spatula));
end
assert(issorted(x))
|
5 | Pass |
for k = 1:20
x = randperm(k);
for spatula = sort_pancakes(x)
x(1:spatula) = flip(x(1:spatula));
end
assert(issorted(x))
end
|
Find the numeric mean of the prime numbers in a matrix.
5913 Solvers
794 Solvers
middleAsColumn: Return all but first and last element as a column vector
317 Solvers
Operate on matrices of unequal, yet similar, size
77 Solvers
construct matrix with identical rows
138 Solvers