Write a function that will generate all possible combinations of grammatically correct parentheses. The function should be able to work with n pairs of parentheses.
Given n = 3, an example solution set would be:
[ "((()))", "(())()", "()(())", "()()()", "(()())" ]
Looking forward to seeing your solutions!
Want to propose a challenge idea for a future post? Email firstname.lastname@example.org with your suggestions!