Generate ParenthesesMediumAcceptance Rate 72.4%Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.ExamplesExample 1Inputn = 3Output["((()))","(()())","(())()","()(())","()()()"]Constraints1 <= n <= 8