DAYS
HOUR
MINS
SEC
Error
Given an integer N representing the number of pairs of parentheses, the task is to generate all combinations of well-formed(balanced) parentheses.
Example 1:
Input:
N = 3
Output:
((()))
(()())
(())()
()(())
()()()
Input:
N = 1
Output:
()
We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?
Yes