so simple and clear
Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
%%
R = 9:-1:5
V = [7 5 6 5];
K = [3 5 4 5];
assert(isequal(refIndex(R,V),K))
R =
9 8 7 6 5
|
2 | Pass |
%%
R = 1:10
V = [];
K = [];
assert(isequal(refIndex(R,V),K))
R =
1 2 3 4 5 6 7 8 9 10
|
3 | Pass |
%%
R = unique(randn(5));
V = R(1:3:end)';
K = 1:3:numel(R);
assert(isequal(refIndex(R,V),K))
|
4 | Pass |
%%
R = -2:2
V = [0 0 0];
K = [3 3 3];
assert(isequal(refIndex(R,V),K))
R =
-2 -1 0 1 2
|
5 | Pass |
%%
R = {'a' 'b' 'c' 'd'}
V = {'b' 'a' 'd'};
K = [2 1 4];
assert(isequal(refIndex(R,V),K))
R =
'a' 'b' 'c' 'd'
|
6 | Pass |
%%
R = {'one' 'two' 'three' 'red' 'yellow' 'blue' 'dog' 'cat' 'fish'}
V = {'one' 'fish' 'two' 'fish' 'red' 'fish' 'blue' 'fish'};
K = [1 9 2 9 4 9 6 9];
assert(isequal(refIndex(R,V),K))
R =
'one' 'two' 'three' 'red' 'yellow' 'blue' 'dog' 'cat' 'fish'
|
Least common multiple of many numbers
159 Solvers
Find third Side of a right triangle given hypotenuse and a side. No * - or other functions allowed
107 Solvers
Generate N equally spaced intervals between -L and L
442 Solvers
279 Solvers
Fahrenheit to Celsius converter
262 Solvers