feat(content): more test cases
This commit is contained in:
@@ -9,6 +9,20 @@ categories:
|
||||
patterns:
|
||||
- backtracking
|
||||
|
||||
function_signature: "def generate_parenthesis(n: int) -> list[str]:"
|
||||
|
||||
test_cases:
|
||||
visible:
|
||||
- input: { n: 3 }
|
||||
expected: ["((()))", "(()())", "(())()", "()(())", "()()()"]
|
||||
- input: { n: 1 }
|
||||
expected: ["()"]
|
||||
hidden:
|
||||
- input: { n: 2 }
|
||||
expected: ["(())", "()()"]
|
||||
- input: { n: 4 }
|
||||
expected: ["(((())))", "((()()))", "((())())", "((()))()", "(()(()))", "(()()())", "(()())()", "(())(())", "(())()()", "()((()))", "()(()())", "()(())()", "()()(())", "()()()()"]
|
||||
|
||||
description: |
|
||||
Given `n` pairs of parentheses, write a function to *generate all combinations of well-formed parentheses*.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user