Cody

Problem 45217. Find a common vertex

Solution 2115095

Submitted on 2 Feb 2020
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Fail
T = [1 2 3;... 1 3 4;... 1 4 2;... 2 3 4]; i = 2; row_idx = [1 3 4]; assert(isequal(your_fcn_name(T,i),row_idx) || isequal(your_fcn_name(T,i),row_idx'))

ans = 4 5 11

Output argument "row_idx" (and maybe others) not assigned during call to "your_fcn_name". Error in Test1 (line 10) assert(isequal(your_fcn_name(T,i),row_idx) || isequal(your_fcn_name(T,i),row_idx'))

2   Fail
T = [1 2 3;... 1 3 4;... 1 4 5;... 1 5 2;... 6 3 2;... 6 4 3;... 6 5 4;... 6 2 5]; i = 4; row_idx = [2 3 6 7]; assert(isequal(your_fcn_name(T,i),row_idx) || isequal(your_fcn_name(T,i),row_idx'))

ans = 11 14 18 23

Output argument "row_idx" (and maybe others) not assigned during call to "your_fcn_name". Error in Test2 (line 14) assert(isequal(your_fcn_name(T,i),row_idx) || isequal(your_fcn_name(T,i),row_idx'))

3   Fail
T = [1 2 4;... 2 3 4;... 5 6 8;... 6 7 8;... 1 2 5;... 2 5 6;... 2 3 6;... 3 6 7;... 3 4 7;... 4 7 8;... 4 1 8;... 1 8 5]; i = 6; row_idx = [3 4 6 7 8]; assert(isequal(your_fcn_name(T,i),row_idx) || isequal(your_fcn_name(T,i),row_idx'))

ans = 4 15 20 30 31

Output argument "row_idx" (and maybe others) not assigned during call to "your_fcn_name". Error in Test3 (line 18) assert(isequal(your_fcn_name(T,i),row_idx) || isequal(your_fcn_name(T,i),row_idx'))

4   Fail
T = [2 3 5;... 3 5 7;... 5 7 11;... 7 11 13]; i = 8; assert(isempty(your_fcn_name(T,i)))

ans = 0×1 empty double column vector

Output argument "row_idx" (and maybe others) not assigned during call to "your_fcn_name". Error in Test4 (line 8) assert(isempty(your_fcn_name(T,i)))

Suggested Problems

More from this Author9

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!