solved generate parentheses