Welcome back.
In this video, let's get started with another interesting coding interview question, which is called
the longest palindromic subsequence question.
The question reads given a string s, find the longest palindromic subsequence length in S, so we are
asked to find the length of the longest palindromic subsequence in a string, which is given to us,
and the question then goes on to define what a subsequence is.
So a subsequence is a sequence that can be derived from another sequence by deleting some or no elements
without changing the order of the remaining elements.
Okay, and then it says string s will have at least one character.
So this means that we don't need to explicitly ensure that our code does not fail if we are given a
string of length zero.
So that's not going to happen because it's mentioned in the question.
And again we are also given an example over here.
If this is the string s which is given to us.
Notice that if we delete these two characters and we are allowed to delete characters as per the definition
of a subsequence given over here.
So if we do that, we are left with a string that is, pee pee pee pee.
And this is a palindrome of length four.
And that's why the expected output, if this is the string s given to us, is equal to four.
So this is the question at hand.
We will be given a string s, and we have to identify the length of the longest palindromic subsequence
that we can form from the given string.
In the next video, let's discuss what approach we can take to solve this question.