I would consider this to be the best solution, though it fails the test cases (only because of the precision of the test suite answers).
Test | Status | Code Input and Output |
---|---|---|
1 | Fail |
%%
a = 100;
u = 'MB';
y_correct = 95.4;
assert(isequal(convert(a,u),y_correct))
Error: Assertion failed.
|
2 | Fail |
%%
a = 10;
u = 'GB';
y_correct = 9.31;
assert(isequal(convert(a,u),y_correct))
Error: Assertion failed.
|
3 | Fail |
%%
a = 500;
u = 'GB';
y_correct = 465.5;
assert(isequal(convert(a,u),y_correct))
Error: Assertion failed.
|
1123 Solvers
173 Solvers
324 Solvers
204 Solvers
Given a 4x4 matrix, swap the two middle columns
300 Solvers