Cody

# Problem 2561. expand intervals vol.3

Solution 1817357

Submitted on 16 May 2019 by Jean-Marie Sainthillier
• Size: 9
• 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
bounds = [1 5 3 9 24 32]; elements = [1 2 3 4 5 6 7 8 9 24 25 26 27 28 29 30 31 32]; assert(isequal(ExpandIntervals(bounds),elements))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In ExpandIntervals (line 2) In ScoringEngineTestPoint1 (line 3) In solutionTest (line 3)]

2   Pass
bounds = [5 1 3 9 32 24]; elements = [1 2 3 4 5 6 7 8 9 24 25 26 27 28 29 30 31 32]; assert(isequal(ExpandIntervals(bounds),elements))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In ExpandIntervals (line 2) In ScoringEngineTestPoint2 (line 3) In solutionTest (line 5)]

3   Pass
bounds = [11 11 9 9]; elements = [9 11]; assert(isequal(ExpandIntervals(bounds),elements))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In ExpandIntervals (line 2) In ScoringEngineTestPoint3 (line 3) In solutionTest (line 7)]

4   Pass
bounds = [200 400 300 100]; elements = [100:400]; assert(isequal(ExpandIntervals(bounds),elements))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In ExpandIntervals (line 2) In ScoringEngineTestPoint4 (line 3) In solutionTest (line 9)]

5   Pass
temp = [-11:1.1:9; -9:9.5]; bounds = temp(:)'; elements = -11:9; assert(isequal(ExpandIntervals(bounds),elements))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In ExpandIntervals (line 2) In ScoringEngineTestPoint5 (line 4) In solutionTest (line 11)]

6   Pass
temp = [-11:1.21:11; -8.7:10]; bounds = temp(:)'; elements = [-11:0, 7:10]; assert(isequal(ExpandIntervals(bounds),elements))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In ExpandIntervals (line 2) In ScoringEngineTestPoint6 (line 4) In solutionTest (line 13)]

7   Pass
temp = [-11:2.599:9; -9:2.601:11]; bounds = temp(:)'; elements = [-11:-7, -5:-2, 0:6, 8:9]; assert(isequal(ExpandIntervals(bounds),elements))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In ExpandIntervals (line 2) In ScoringEngineTestPoint7 (line 4) In solutionTest (line 15)]

8   Pass
bounds = [-10.8 10.9]; elements = -10:10; assert(isequal(ExpandIntervals(bounds),elements))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In ExpandIntervals (line 2) In ScoringEngineTestPoint8 (line 3) In solutionTest (line 17)]

9   Pass
bounds = [10.8 -10.9]; elements = -10:10; assert(isequal(ExpandIntervals(bounds),elements))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In ExpandIntervals (line 2) In ScoringEngineTestPoint9 (line 3) In solutionTest (line 19)]