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
|
159 Solvers
Determine if input is a Narcissistic number
94 Solvers
251 Solvers
Remove entire row and column in the matrix containing the input values
111 Solvers
Matrix multiplication across rows
118 Solvers