Cody

# Problem 2220. Wayfinding 3 - passed areas

Solution 547738

Submitted on 18 Dec 2014 by rifat
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   Pass
%% AB = [ 2 -2 ; 8 -6 ]; F{1} = [ -4 -4 4 4 -4 -0 -0 -4 ]; F{2} = [ -4 -4 4 4 2 6 6 2 ]; f = WayfindingPassed(AB,F); f_correct = [2 1]; assert(isequal(f,f_correct)); %% AB = [ 8 -4 ; 8 -8 ]; F{1} = [ -6 2 2 -4 -4 8 8 -6 -6 -6 -4 -4 2 2 4 4 ]; F{2} = [ -2 -2 4 4 -0 -2 -2 -0 ]; f = WayfindingPassed(AB,F); f_correct = [ 1 2 1 ]; assert(isequal(f,f_correct)); %% AB = [ -8 8 ; 8 -8 ]; F{1} = [ -2 -2 0 0 -0 2 2 -0 ]; F{2} = [ 2 4 4 -6 -6 -4 2 4 4 2 2 -4 -4 2 -0 -0 -6 -6 4 6 6 4 2 2 4 4 -4 -4 ]; F{3} = [ -3 -3 1 0 -1 -3 -3 -1 ]; F{4} = [ 5 9 9 5 -3 -3 -9 -9 ]; F{5} = [ -9 -10 -10 -9 9 9 10 10 ]; f = WayfindingPassed(AB,F); f_correct = [ 2 1 2 4 ]; assert(isequal(f,f_correct)); AB = [ 0 0 ; -8 8 ]; F{1} = [ -4 -2 -2 -4 8 8 4 4 ]; F{2} = [ 2 4 4 2 -0 -0 -6 -6 ]; F{3} = [ -4 -2 -2 -6 -6 -4 -4 -6 -6 -4 ]; f = WayfindingPassed(AB,F); assert(isempty(f)); %% AB = [ 7 -8 ; 0 0 ]; F{1} = [ 8 9 9 8 3 3 -2 -2 ]; F{2} = [ -9 -7 -7 -4 -4 -3 -3 0 0 1 1 4 4 5 5 -2 -8 -9 -2 -2 2 2 -2 -2 2 2 -2 -2 2 2 -2 -2 3 4 3 2 ]; F{3} = [ -2 -1 -1 -2 1 1 -4 -4 ]; F{4} = [ -6 -5 -5 -3 1 2 2 3 3 1 -4 -6 1 1 -3 -5 -5 -4 1 1 -5 -8 -7 -4 ]; f = WayfindingPassed(AB,F); f_correct = [ 2 4 2 3 2 4 2 ]; assert(isequal(f,f_correct)); %% AB = [ 0 -2 ; 0 -4 ]; F{1} = [ -3 3 3 2 2 -2 -2 2 2 -3 -5 -5 3 3 -3 -3 2 2 3 3 ]; F{2} = [ -1 1 1 -1 1 1 -1 -1 ]; F{3} = [ -4 4 4 5 5 -5 -5 -4 4 4 -7 -7 5 5 -1 -1 ]; F{4} = [ -5 -4 -4 4 4 -5 -1 -1 -6 -6 -7 -7 ]; f = WayfindingPassed(AB,F); f_correct = [ 2 1 ]; assert(isequal(f,f_correct)); %% AB = [ -2 0 ; 6 -6 ]; F{1} = [ 2 -4 -4 2 2 -2 0 -2 2 -4 -4 4 4 2 2 -0 -2 -2 ]; f = WayfindingPassed(AB,F); f_correct = [ 1 1 1 ]; assert(isequal(f,f_correct));

### Community Treasure Hunt

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

Start Hunting!