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,30 @@ categories:
patterns:
- dynamic-programming
function_signature: "def num_distinct(s: str, t: str) -> int:"
test_cases:
visible:
- input: { s: "rabbbit", t: "rabbit" }
expected: 3
- input: { s: "babgbag", t: "bag" }
expected: 5
hidden:
- input: { s: "a", t: "a" }
expected: 1
- input: { s: "a", t: "b" }
expected: 0
- input: { s: "aaa", t: "a" }
expected: 3
- input: { s: "aaa", t: "aa" }
expected: 3
- input: { s: "aaa", t: "aaa" }
expected: 1
- input: { s: "abc", t: "def" }
expected: 0
- input: { s: "abcde", t: "" }
expected: 1
description: |
Given two strings `s` and `t`, return *the number of distinct **subsequences** of* `s` *which equals* `t`.