Cody

# Problem 2219. Wayfinding 2 - traversing

Solution 1632977

Submitted on 25 Sep 2018 by Suraj Gurav
• Size: 69
• This is the leading solution.
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 = [ 0 0 ; 6 -8 ]; F = [ -4 4 4 -4 2 2 -4 -4 ]; n = WayfindingBoundaryCrossing(AB,F); n_correct = 2; assert(isequal(n,n_correct));

n = 2

2   Pass
AB = [ 0 0 ; 4 -6 ]; F = [ -6 4 0 -0 2 -4 ]; n = WayfindingBoundaryCrossing(AB,F); n_correct = 2; assert(isequal(n,n_correct));

n = 2

3   Pass
AB = [ 6 -6 ; 0 0 ]; F = [ -8 -8 4 2 -4 -0 ]; n = WayfindingBoundaryCrossing(AB,F); n_correct = 1; assert(isequal(n,n_correct));

n = 1

4   Pass
AB = [ 8 -6 ; 6 -8 ]; F = [ -6 0 -3 7 9 4 6 -4 -7 -2 -7 -8 -9 -9 0 -4 1 7 -0 4 -1 -7 -5 -9 ]; n = WayfindingBoundaryCrossing(AB,F); n_correct = 7; assert(isequal(n,n_correct));

n = 7

5   Pass
n_correct = randi(9)-1; AB = [ 0 0 ; n_correct*2-9 -10 ]; F = [ -2 -2 2 2 -2 -2 2 2 -2 -2 2 2 -2 -2 4 4 -8 -6 -6 -4 -4 -2 -2 -0 -0 2 2 4 4 6 6 -8 ]; n = WayfindingBoundaryCrossing(AB,F); assert(isequal(n,n_correct));

n = 3

### Community Treasure Hunt

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

Start Hunting!