Class Solution
java.lang.Object
g0001_0100.s0022_generate_parentheses.Solution
22 - Generate Parentheses.<p>Medium</p>
<p>Given <code>n</code> pairs of parentheses, write a function to <em>generate all combinations of well-formed parentheses</em>.</p>
<p><strong>Example 1:</strong></p>
<p><strong>Input:</strong> n = 3</p>
<p><strong>Output:</strong> [“((()))”,“(()())”,“(())()”,“()(())”,“()()()”]</p>
<p><strong>Example 2:</strong></p>
<p><strong>Input:</strong> n = 1</p>
<p><strong>Output:</strong> [“()”]</p>
<p><strong>Constraints:</strong></p>
<ul>
<li><code>1 <= n <= 8</code></li>
</ul>
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Solution
public Solution()
-
-
Method Details
-
generateParenthesis
-