Back to Questions

Balanced Parentheses (Generative)

85.6K viewsAsked at Google
Medium

Question Explain

Given $n$ pairs of parentheses, write a function to generate all combinations of well-formed parentheses. Use a Backtracking approach and track the counts of open and close brackets.

Start Trying This Question Simulation

Practice answering orally or with text to get instant AI feedback.

Practice with This Question
Balanced Parentheses (Generative) - Interview Question