Cody

# Problem 2773. Find the distance between runs

Solution 1607970

Submitted on 13 Aug 2018 by HH
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
v = [1,2,5,6,7,8,9,20,21,22,30,31,32,33,34,35,40,41,42,43,44]; distances = [21 5]; assert(isequal(rundistances(v),distances))

s = 3 4 11 12 13 17 18 f = 2 5 ans = 21 ans = 21 5

2   Pass
v = [1:2:10, 14:20, 22, 23, 30:35, 37:39, 41:50, 52, 54:58, 60, 62]; distances = [30-20, 41-35, 54-50]; assert(isequal(rundistances(v),distances))

s = 6 7 8 9 15 16 17 24 25 26 27 28 29 30 35 36 f = 4 7 14 ans = 10 ans = 10 6 ans = 10 6 4

3   Pass
v = [-1 5:9 14 70:76 82]; distances = [70-9]; assert(isequal(rundistances(v),distances))

s = 2 3 8 9 10 11 f = 2 ans = 61

4   Pass
v = 1:100; assert(isempty(rundistances(v)))

s = Columns 1 through 29 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 Columns 30 through 58 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 Columns 59 through 87 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 Columns 88 through 97 88 89 90 91 92 93 94 95 96 97 f = 1×0 empty double row vector

5   Pass
v = [1:3:100]; assert(isempty(rundistances(v)))

s = [] f = []