feat(content): function signatures + test cases

This commit is contained in:
2025-07-13 19:53:34 +01:00
parent d65ccf7dc2
commit 0262ca8bf6
203 changed files with 4526 additions and 0 deletions

View File

@@ -11,6 +11,32 @@ patterns:
- dynamic-programming
- monotonic-stack
function_signature: "def longest_valid_parentheses(s: str) -> int:"
test_cases:
visible:
- input: { s: "(()" }
expected: 2
- input: { s: ")()())" }
expected: 4
- input: { s: "" }
expected: 0
hidden:
- input: { s: "()" }
expected: 2
- input: { s: "()()" }
expected: 4
- input: { s: "((()))" }
expected: 6
- input: { s: "(()()" }
expected: 4
- input: { s: ")()()((" }
expected: 4
- input: { s: "((((((" }
expected: 0
- input: { s: "))))))" }
expected: 0
description: |
Given a string containing just the characters `'('` and `')'`, return *the length of the longest valid (well-formed) parentheses substring*.