Generate Parentheses
Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.

30:00

Generate Parentheses
medium
Topics
Companies

Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.

Example 1:
Input: 3
Output: ["((()))","(()())","(())()","()(())","()()()"]
Constraints:
  • 1n81 \leq n \leq 8

Input
arr =3

Start generating

n
3
Open Count
0
Close Count
0
Current
_
Results (0)
Variables
VariableValue
n3
DepthFunction Call
Stack empty
0/27