Join Regular Classroom : Visit ClassroomTech

Coding Questions | Longest Palindromic Subsequence | Codewindow.in

Given a string x (1<=len(x)<=1000) find the length of its longest palindromic subsequence. The string contains only lowercase letters. Write a program that takes in input as String x and returns the length of the longest palindromic subsequence of x.

Input Format:
String input.

Output Format:
return the length of the longest palindromic subsequence.

Example :
Input:
ababa

Output:
5

Explanation:
Length of longest palindromic sequence is 5 that is “ababa”.

Solution:

Coming....
You Missed
Also Checkout