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

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