Generate all Combinations of Balanced Parentheses

Generate all combinations of balanced parentheses for the n number of parentheses pairs.


Write a function to generate all balanced combinations of nn pairs of parentheses.


Here are a few examples:

Level up your interview prep. Join Educative to access 70+ hands-on prep courses.