Looking for good programming challenges?

Use the search below to find our solutions for selected questions!

Implement an algorithm to print all valid (e g , properly opened and closed) combinations of n-pairs of parentheses

Sharing is caring!

Problem Statement
Implement an algorithm to print all valid (e g , properly opened and closed) combinations of n-pairs of parentheses

Example
Input: 3 (e g , 3 pairs of parentheses)
Output: ()()(), ()(()), (())(), ((()))

Solution