Coding Challenge

Generate Parentheses

Medium
backtrackingstring

Generate all valid parenthesis strings of length 2n.

Return every valid combination of n pairs of parentheses.

Examples

Input: n = 3

Output: ["((()))","(()())","(())()","()(())","()()()"]

Constraints

  • 1 <= n

Preparing your coding workspace...