Community

Start a Thread


Notifications
Subscribe You’re not receiving notifications from this thread.

Length of Longest Palindromic Subsequence (Main Thread)

Here is the interview question prompt, presented for reference.

Question/Prompt

A palindrome is a word, phrase, or sequence that reads the same backward or forwards. A palindromic subsequence is a palindrome derived from a sequence by deleting some or no elements from it. This subsequence is formed without changing the order of the elements in the original sequence.

Given a string s, can you find the length of the longest palindromic subsequence of s?

![image](https://storage.googleapis.com/algodailyrandomassets/curriculum/easy-strings/length-longest-palindromic-subsequence/problem.png)

For example, if s = "bbbab", then the longest palindromic subsequence is bbbb. The length of this subsequence is 4, which is the required answer.

Constraints

  • 1 <= s.length <= 1000
  • s consists only of lowercase English letters.

You can see the full challenge with visuals at this link.

Challenges • Asked about 2 years ago by Jake from AlgoDaily

Jake from AlgoDaily Commented on Dec 01, 2022:

This is the main discussion thread generated for Length of Longest Palindromic Subsequence (Main Thread).