Given a string s, return the length of the longest palindromic subsequence (characters keep their order but need not be adjacent).
s
s = "bbbab"
4
Why
"bbbb"
s = "cbbd"
2
1 <= s.length <= 1000 `s` consists of lowercase English letters.
Topics
Implement longestPalindromeSubseq in the editor and return the answer — printing it is never graded.
longestPalindromeSubseq
Problem 110 of 1146 in the arena