The leading solution (solution 103932) is wrong and doesn't work. The error is that the output argument "ans" is not assigned.
@Norbert, this trick worked in Cody before, now it doesn't. I wrote trick, cause it was a way to have a little bit lower Cody size. It was questioned why it's not banned, because it favours bad programming practices, so changes were made.
Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
%%
x = sort(rand(1,10^5));
y_correct = 1;
assert(isequal(sortok(x),y_correct))
ans =
1
|
2 | Pass |
%%
x = [1 5 4 3 8 7 3];
y_correct = 0;
assert(isequal(sortok(x),y_correct))
ans =
0
|
It dseon't mettar waht oedrr the lrettes in a wrod are.
494 Solvers
2283 Solvers
Back to basics 13 - Input variables
203 Solvers
178 Solvers
Tick. Tock. Tick. Tock. Tick. Tock. Tick. Tock. Tick. Tock.
615 Solvers