प्रश्न
00:00

17. Generate Parentheses

मध्यमबैकट्रैकिंगAmazonGoogleMicrosoft

Given n pairs of parentheses, generate all combinations of well-formed parentheses.

उदाहरण 1:

इनपुट: n = 3
आउटपुट: ["((()))","(()())","(())()","()(())","()()()"]

उदाहरण 2:

इनपुट: n = 1
आउटपुट: ["()"]

सीमाएँ:

  • 1 <= n <= 8
मुख्य कोड मोड
● अपने आप सहेजा गयापंक्ति 1, कॉलम 1