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