generate parentheses from leetcode updated