Longest Palindromic Subsequence Length

Python Hard 6 views
Back to Questions

Problem Description

For each testcase you get string s. Output length of longest palindromic subsequence.

Input Format

First line t. Next t lines strings.

Output Format

t lines lengths.

Sample Test Case

Input:
2 bbbab cbbd
Output:
4 2

Constraints

Total length over all testcases

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next