mirror of
				https://gitee.com/coder-xiaomo/leetcode-problemset
				synced 2025-11-04 11:43:12 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			16 lines
		
	
	
		
			410 B
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			16 lines
		
	
	
		
			410 B
		
	
	
	
		
			HTML
		
	
	
	
	
	
<p>Implement an algorithm to print all valid (e.g., properly opened and closed) combinations of n pairs of parentheses.</p>
 | 
						|
 | 
						|
 | 
						|
 | 
						|
<p>Note: The result set should not contain duplicated subsets.</p>
 | 
						|
 | 
						|
 | 
						|
 | 
						|
<p>For example, given n = 3, the result should be:</p>
 | 
						|
 | 
						|
 | 
						|
 | 
						|
<pre>
 | 
						|
 | 
						|
[
 | 
						|
 | 
						|
  "((()))",
 | 
						|
 | 
						|
  "(()())",
 | 
						|
 | 
						|
  "(())()",
 | 
						|
 | 
						|
  "()(())",
 | 
						|
 | 
						|
  "()()()"
 | 
						|
 | 
						|
]
 | 
						|
 | 
						|
</pre>
 | 
						|
 |