feat(content): function signatures + test cases
This commit is contained in:
@@ -9,6 +9,32 @@ categories:
|
||||
patterns:
|
||||
- dynamic-programming
|
||||
|
||||
function_signature: "def is_interleave(s1: str, s2: str, s3: str) -> bool:"
|
||||
|
||||
test_cases:
|
||||
visible:
|
||||
- input: { s1: "aabcc", s2: "dbbca", s3: "aadbbcbcac" }
|
||||
expected: true
|
||||
- input: { s1: "aabcc", s2: "dbbca", s3: "aadbbbaccc" }
|
||||
expected: false
|
||||
- input: { s1: "", s2: "", s3: "" }
|
||||
expected: true
|
||||
hidden:
|
||||
- input: { s1: "a", s2: "b", s3: "ab" }
|
||||
expected: true
|
||||
- input: { s1: "a", s2: "b", s3: "ba" }
|
||||
expected: true
|
||||
- input: { s1: "abc", s2: "def", s3: "abcdef" }
|
||||
expected: true
|
||||
- input: { s1: "", s2: "abc", s3: "abc" }
|
||||
expected: true
|
||||
- input: { s1: "abc", s2: "", s3: "abc" }
|
||||
expected: true
|
||||
- input: { s1: "a", s2: "b", s3: "abc" }
|
||||
expected: false
|
||||
- input: { s1: "aaa", s2: "aaa", s3: "aaaaaa" }
|
||||
expected: true
|
||||
|
||||
description: |
|
||||
Given strings `s1`, `s2`, and `s3`, find whether `s3` is formed by an **interleaving** of `s1` and `s2`.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user