Good solution for generate parenthesis.