Longest Palindromic Subsequence – Leetcode Java

Given a string s, find the longest palindromic subsequence’s length in s. You may assume that the maximum length of s is 1000.
Example 1:
Input:

Output:

One possible longest palindromic subsequence is “bbbb”.

Example 2:
Input:

Output:

One possible longest palindromic subsequence is “bb”.

Java Solution

 

You can find the source code at github

T Tak

Hey ! I'm Tak. I'm a software developer since 2008 and been programming since I was 17 years, started with pascal. I love programming, teaching and building stuff on web.

2 thoughts to “Longest Palindromic Subsequence – Leetcode Java”

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.