Cody

Problem 1686. Generate a melodic contour string matrix

Solution 2101327

Submitted on 21 Jan 2020
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   Fail
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)]

Output argument "ans" (and maybe others) not assigned during call to "parsons". Error in Test1 (line 3) assert(strcmp(parsons(str),melody))

2   Fail
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)]

Output argument "ans" (and maybe others) not assigned during call to "parsons". Error in Test2 (line 5) assert(strcmp(parsons(str),melody))

3   Fail
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)]

Output argument "ans" (and maybe others) not assigned during call to "parsons". Error in Test3 (line 9) assert(strcmp(parsons(str),melody))

4   Fail
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)]

Output argument "ans" (and maybe others) not assigned during call to "parsons". Error in Test4 (line 7) assert(strcmp(parsons(str),melody))

5   Fail
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)]

Output argument "ans" (and maybe others) not assigned during call to "parsons". Error in Test5 (line 13) assert(strcmp(parsons(str),melody))