516. Longest Palindromic Subsequence
516. Longest Palindromic Subsequence
Description
Solution
Use DP to find the longest palindromic subsequence
in one interval
1 | //dp[i][j] = (i > j) from j to i, longest palinidromic subsequence |
Code
1 | class Solution { |
All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.