Construct Valid Bracket Sequences - Coding problem | OneNoughtOne