Generate Parentheses

Medium

📝 Description

Generate all valid combinations of n pairs of parentheses

Input Format

Integer n

Output Format

List of valid strings

Constraints

1 ≤ n ≤ 8

🔍 Sample Input

3
            

✅ Sample Output

["((()))","(()())","(())()","()(())","()()()"]
            

Code Editor

Please login to run and submit code.

Shortcuts: Ctrl+Enter to submit, Ctrl+Shift+R to run