feat(content): more test cases

This commit is contained in:
2025-07-13 19:25:39 +01:00
parent e28da5def2
commit 0f264ef603
94 changed files with 1840 additions and 0 deletions

View File

@@ -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*.