Cody

Solution 62631

Submitted on 18 Mar 2012
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
%% 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>
2   Pass
%% 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>
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))
Error: Assertion failed.