Cody

# Problem 1686. Generate a melodic contour string matrix

Solution 2101329

Submitted on 21 Jan 2020 by Allen
• Size: 7
• 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
str = '*rrr'; melody = '*-*-*-*'; assert(strcmp(parsons(str),melody))

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

2   Pass
str = '*du'; melody = ['* *' ' \ / ' ' * ']; assert(strcmp(parsons(str),melody))

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

3   Pass
str = '*ruuddduur'; melody = [' * ' ' / \ ' ' * * *-*' ' / \ / ' '*-* * * ' ' \ / ' ' * ']; assert(strcmp(parsons(str),melody))

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

4   Pass
str = '*rududdrudud'; melody = [' * * ' ' / \ / \ ' '*-* * * * * ' ' \ / \ / \ ' ' *-* * *']; assert(strcmp(parsons(str),melody))

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

5   Pass
str = '*rururddrdrdrd'; melody = [' *-* ' ' / \ ' ' *-* * ' ' / \ ' '*-* *-* ' ' \ ' ' *-* ' ' \ ' ' *-* ' ' \ ' ' *']; assert(strcmp(parsons(str),melody))

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

### Community Treasure Hunt

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

Start Hunting!