Ezvor

1682. Longest Palindromic Subsequence II

MediumString Preparing judge… LeetCode
StringDynamic Programming

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.