...

/

Generate all Combinations of Balanced Parentheses

Generate all Combinations of Balanced Parentheses

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

Statement

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

Example

Here are a few examples:

foo a1 N: 1 {} a2 N: 2 {{}} {}{} a3 N: 3 {{{}}} {}{{}} {{}{}} {{}}{} {}{}{}

The test cases will use values of ...

Access this course and 1400+ top-rated courses and projects.