This solution is outdated. To rescore this solution, sign in.
Dear Oscar,
in comparison to your code, the below implementation is much faster but your style of code is a crack to cody system, well done.
function A = column_removal(A,n)
A(:,n) = '';
end
Dear Sadid, I agree with you that my implementation is completely stupid and a waste of time in real life and that's why I don't like the current evaluation metric of Cody. A (time and/or memory)-based evaluation would be much more interesting. With the current evaluation metric, Cody promotes hacking and cracking (which is also fine), but players don't learn good manners for developing efficient code.
NICE ONE BUT BIT DIFFICULT
@Óscar yes, you are right. the player can't study the one with well written style
agreed with Oscar
Test | Status | Code Input and Output |
---|---|---|
1 | Fail |
%%
A = [1 2 3; 4 5 6];
n = 2;
B_correct = [1 3; 4 6];
assert(isequal(column_removal(A,n),B_correct))
Error: You may not use the command(s) str2func in your code
|
2 | Fail |
%%
A = magic(4);
n = 3;
B = [16 2 13;
5 11 8;
9 7 12;
4 14 1];
B_correct = B;
assert(isequal(column_removal(A,n),B_correct))
Error: You may not use the command(s) str2func in your code
|
3 | Fail |
%%
A = 1:10;
n = 7;
B_correct = [1 2 3 4 5 6 8 9 10];
assert(isequal(column_removal(A,n),B_correct))
Error: You may not use the command(s) str2func in your code
|
5171 Solvers
367 Solvers
Sum of first n terms of a harmonic progression
189 Solvers
Find a subset that divides the vector into equal halves
289 Solvers
207 Solvers