bugl
bugl
HomeLearnPatternsPathsSearchPremium
HomeLearnPatternsPaths
MediumBacktrackingLC 22

Generate Parentheses

Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.

Asked at 24 companies
AdobeAlibabaAmazon
Hints
  • 1.Think about what data structure fits Generate Parentheses
  • 2.Consider the brute force complexity and how to optimize
  • 3.Can you trade space for time?
LeetCodeNeetCode