Code for problem "Generate Parentheses".