Fetching data...
This may take a moment
Back
1822. Longest Palindromic Subsequence II
Medium
String
Dynamic Programming
Solve on LeetCode
View Solutions
Description
Hints
Hint 1
As with any good dp problem that uses palindromes, try building the palindrome from the edges
Hint 2
The prime point is to check that no two adjacent characters are equal, so save the past character while building the palindrome.
Similar Questions
Longest Palindromic Subsequence
Medium
Statistics
Acceptance
50.5%
Submissions
12,521
Accepted
6,318