------
## 最终结论
```python
def longest_common_subsequence(seq1, seq2, len1, len2):
    # Initialize DP table
    dp = [[0] * (len2 + 1) for _ in range(len1 + 1)]
    
    # Fill the DP table
    for i in range(1, len1 + 1):
        for j in range(1, len2 + 1):
            if seq1[i - 1] == seq2[j - 1]:
                dp[i][j] = dp[i - 1][j - 1] + 1
            else:
                dp[i][j] = max(dp[i - 1][j], dp[i][j - 1])
    
    return dp[len1][len2]
```