I dont get whay sort(unique(ix)) will give you the location of the two points. it is wrong for these points (0.9631 0.5468),(0.5211 0.2316),(0.4889,0.6241),(0.6791 0.3955),(0.3670 0.9890),
sort(unique(ix)) will return [1 2 5].
I think this solution is not right
I agree.
there may be something out of word,
if i put:
p =[1 0; 0 1;0 0; 1/sqrt(2) 1/sqrt(2) ]
your command would not right,
but 'unique' is very admirable.
Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
%%
p = [0 0;
1 0;
2 2;
0 1];
ix_correct = [1 3];
assert(isequal(mostDistant(p),ix_correct))
|
2 | Pass |
%%
p = [0 0;
1 0;
2 2;
0 10];
ix_correct = [2 4];
assert(isequal(mostDistant(p),ix_correct))
|
3 | Pass |
%%
p = [0 0;
-1 50];
ix_correct = [1 2];
assert(isequal(mostDistant(p),ix_correct))
|
4 | Pass |
%%
p = [5 5;
1 0;
2 2;
0 10;
-100 20;
1000 400];
ix_correct = [5 6];
assert(isequal(mostDistant(p),ix_correct))
|
Get the area codes from a list of phone numbers
417 Solvers
Calculate the Levenshtein distance between two strings
303 Solvers
Generate a vector like 1,2,2,3,3,3,4,4,4,4
1563 Solvers
The sum of the numbers in the vector
341 Solvers
377 Solvers