Company: Quadeye_17sep
Difficulty: medium
String Practice Problem Description A palindrome is a sequence that reads the same forwards and backwards, such as "tacocat" or "1221", but not "tacocats" or "8675". A subsequence is derived by deleting zero or more characters from the original sequence while maintaining the order of the remaining characters. For instance, the subsequences of "abc" include "a", "b", "c", "ab", "ac", "bc", and "abc". Given a string s composed of n lowercase English letters, identify the length of the longest palindromic subsequence within s. For example, if n = 3 and s = 'abc' , the only palindromic subsequences are a, b, and c, each with a length of 1. The longest palindromic subsequence of s is 1. Function Description Complete the function longestPalindrome in the editor with has the following parameter(s): int n : the length of the string string s : a string containing n characters Return int : the length of the longest palindromic subsequence of s Examples Example 1: Input: n = 2, s = 'ba' Output: 1