Generate Parentheses
Try to solve the Generate Parentheses problem.
We'll cover the following
1 of 2
2 of 2
Understand the problem#
Let’s take a moment to make sure you’ve correctly understood the problem. The quiz below helps you check if you’re solving the correct problem:
Generate Parentheses
1
Which is a valid combination of balanced parentheses when n = 2?
A)
()()
(())
((()
B)
(())
))((
()()
C)
()()
(())
Question 1 of 30 attempted
Figure it out!#
We have a game for you to play. Rearrange the logical building blocks to develop a clearer understanding of how to solve this problem.
Try it yourself#
Implement your solution in main.py in the following coding playground. We have provided a useful code template in the other file, that you may build on to solve this problem.
Python
main.py
backtracking.py
Generate Parentheses
Solution: Letter Combinations of a Phone Number
Solution: Generate Parentheses