Problem of the day
The only line of input contains an integer ‘N’ representing the given number of parentheses.
The output contains all possible valid parentheses printed in different lines.
The order in which different combinations of well-formed parentheses are printed doesn't matter.
1 <= N <= 10
Time Limit: 1sec
3
{{{}}}
{{}{}}
{{}}{}
{}{{}}
{}{}{}
These are the only five sequences of balanced parentheses formed using 3 pairs of balanced parentheses.
2
{{}}
{}{}