LLLLLjian

Results 2 comments of LLLLLjian

麻烦问一下 备忘录解法 为什么用的是 dp(s, i + 1, j - 1) + 1; 而不是 dp(s, i + 1, j - 1) + 2

贴一下我的理解 python版本 ```python class Solution: def longestPalindromeSubseq(self, s: str) -> int: if not s: return 0 length = len(s) # 备忘录 # 字符串s在[i, j]范围内最长的回文子序列的长度为memo[i][j] memo = [[0] * length for...