Cody

# Problem 45218. Find a common edge

Solution 2089855

Submitted on 12 Jan 2020 by Asif Newaz
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

This solution is outdated. To rescore this solution, sign in.

### Test Suite

Test Status Code Input and Output
1   Pass
T = [1 2 3; 1 3 4; 1 4 2; 2 3 4]; e = [2 3]; row_idx = [1 4]; assert(isequal(find_common_edge(T,e),row_idx) || isequal(find_common_edge(T,e),row_idx'))

b = 2 c = 3 b = 1×0 empty double row vector c = 2 b = 3 c = 1×0 empty double row vector b = 1 c = 2

2   Pass
T = [1 2 3; 1 3 4; 1 4 2; 2 3 4]; e = [2 4]; row_idx = [3 4]; assert(isequal(find_common_edge(T,e),row_idx) || isequal(find_common_edge(T,e),row_idx'))

b = 2 c = 1×0 empty double row vector b = 1×0 empty double row vector c = 3 b = 3 c = 2 b = 1 c = 3

3   Pass
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]; e = [1 5]; row_idx = [3 4]; assert(isequal(find_common_edge(T,e),row_idx) || isequal(find_common_edge(T,e),row_idx'))

b = 1 c = 1×0 empty double row vector b = 1 c = 1×0 empty double row vector b = 1 c = 3 b = 1 c = 2 b = 1×0 empty double row vector c = 1×0 empty double row vector b = 1×0 empty double row vector c = 1×0 empty double row vector b = 1×0 empty double row vector c = 2 b = 1×0 empty double row vector c = 3

4   Pass
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]; e = [6 7]; row_idx = [4 8]; assert(isequal(find_common_edge(T,e),row_idx) || isequal(find_common_edge(T,e),row_idx'))

b = 1×0 empty double row vector c = 1×0 empty double row vector b = 1×0 empty double row vector c = 1×0 empty double row vector b = 2 c = 1×0 empty double row vector b = 1 c = 2 b = 1×0 empty double row vector c = 1×0 empty double row vector b = 3 c = 1×0 empty double row vector b = 3 c = 1×0 empty double row vector b = 2 c = 3 b = 1×0 empty double row vector c = 3 b = 1×0 empty double row vector c = 2 b = 1×0 empty double row vector c = 1×0 empty double row vector b = 1×0 empty double row vector c = 1×0 empty double row vector

5   Pass
T = [2 3 5; 3 5 7; 5 7 11; 7 11 13]; e = [6 28]; assert(isempty(find_common_edge(T,e)))

b = 1×0 empty double row vector c = 1×0 empty double row vector b = 1×0 empty double row vector c = 1×0 empty double row vector b = 1×0 empty double row vector c = 1×0 empty double row vector b = 1×0 empty double row vector c = 1×0 empty double row vector