feat(content): function signatures + test cases
This commit is contained in:
@@ -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*.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user