Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
x = 'ABCD';
y_correct = 'ABDC';
assert(isequal(nextP(x),y_correct))
x = 'ABDC';
y_correct = 'ACBD';
assert(isequal(nextP(x),y_correct))
x = 'ACBD';
y_correct = 'ACDB';
assert(isequal(nextP(x),y_correct))
x = 'ACDB';
y_correct = 'ADBC';
assert(isequal(nextP(x),y_correct))
x = 'LOVE';
y_correct = 'LVEO';
assert(isequal(nextP(x),y_correct))
x = 'CAST';
y_correct = 'CATS';
assert(isequal(nextP(x),y_correct))
x = 'THEQUICKBROWNFOXJUMPEDOVERTHELAZYDOG';
y_correct = 'THEQUICKBROWNFOXJUMPEDOVERTHELAZYGOD';
assert(isequal(nextP(nextP(x)),y_correct));
s = 1;
x = 'ABCDE';
y_correct = 120;
y = x;
while(1)
y = nextP(y);
if ( strcmp(x,y) ) break; end
s = s+1;
end
assert(s == y_correct)
|
59 Solvers
Back to basics 25 - Valid variable names
293 Solvers
232 Solvers
Find the elements of a matrix according to a defined property.
71 Solvers
Right Triangle Side Lengths (Inspired by Project Euler Problem 39)
511 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!