Day 1 : Generate Parentheses
mediumRecursion
Given $n$ pairs of parentheses, write a function to generate all combinations of well-formed parentheses. Parentheses should be sorted, i.e. consider two parentheses with the first position of difference having '(' and ')' then parenthesis with '(' should be printed first.
Input Format:
The first and only line of input contains an integer $n$
Output Format:
You need to input the number of combinations $C$ followed by $C$ lines each containing the parentheses.
Constraints:
Examples: