feat(content): more test cases
This commit is contained in:
@@ -9,6 +9,24 @@ categories:
|
||||
patterns:
|
||||
- dynamic-programming
|
||||
|
||||
function_signature: "def longest_common_subsequence(text1: str, text2: str) -> int:"
|
||||
|
||||
test_cases:
|
||||
visible:
|
||||
- input: { text1: "abcde", text2: "ace" }
|
||||
expected: 3
|
||||
- input: { text1: "abc", text2: "abc" }
|
||||
expected: 3
|
||||
- input: { text1: "abc", text2: "def" }
|
||||
expected: 0
|
||||
hidden:
|
||||
- input: { text1: "a", text2: "a" }
|
||||
expected: 1
|
||||
- input: { text1: "a", text2: "b" }
|
||||
expected: 0
|
||||
- input: { text1: "oxcpqrsvwf", text2: "shmtulqrypy" }
|
||||
expected: 2
|
||||
|
||||
description: |
|
||||
Given two strings `text1` and `text2`, return *the length of their longest **common subsequence***. If there is no **common subsequence**, return `0`.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user