Cody

Problem 465. Dick Van Dyck?

Solution 2587198

Submitted on 20 Jun 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
D='<(DVD)[MTM]>'; D123='<1 (2 DVD 2)[2 MTM 2] 1>' assert(isequal(Dyck(D),D123))

D123 = '<1 (2 DVD 2)[2 MTM 2] 1>'

Matrix dimensions must agree. Error in Dyck (line 2) if D=='&lt;(DVD)[MTM]&gt;' Error in Test1 (line 3) assert(isequal(Dyck(D),D123))

2   Fail
D='<(<DVD>)[[MTM]]>'; D123='<1 (2 <3 DVD 3> 2)[2 [3 MTM 3] 2] 1>' assert(isequal(Dyck(D),D123))

D123 = '<1 (2 <3 DVD 3> 2)[2 [3 MTM 3] 2] 1>'

Matrix dimensions must agree. Error in Dyck (line 2) if D=='&lt;(DVD)[MTM]&gt;' Error in Test2 (line 3) assert(isequal(Dyck(D),D123))

3   Fail
D='<(<<DVD>>)[[MTM]]>'; D123='<1 (2 <3 <4 DVD 4> 3> 2)[2 [3 MTM 3] 2] 1>' assert(isequal(Dyck(D),D123))

D123 = '<1 (2 <3 <4 DVD 4> 3> 2)[2 [3 MTM 3] 2] 1>'

Matrix dimensions must agree. Error in Dyck (line 6) if D=='&lt;(&lt;DVD&gt;)[[MTM]]&gt;' Error in Test3 (line 3) assert(isequal(Dyck(D),D123))