feat(content): more test cases

This commit is contained in:
2025-07-13 19:25:39 +01:00
parent d2b74b6863
commit 85fea3a4bb
94 changed files with 1840 additions and 0 deletions

View File

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