Strings

Generate Parentheses

medium
Given `n` pairs of parentheses, generate all combinations of well-formed parentheses. Example: `generateParenthesis(3)` → `["((()))","(()())","(())()","()(())","()()()"]` (any order).
Hint steps(0/3 revealed)
  1. 1

    Complete previous step or reveal to unlock this hint.

  2. 2

    Complete previous step or reveal to unlock this hint.

  3. 3

    Complete previous step or reveal to unlock this hint.