Longest Palindrome

Try to solve the Longest Palindrome problem.

Statement

Given a string s that only contains alphabets, return the length of the longest palindrome that may be composed using those letters.

Note: Letters are case-sensitive. Hence, combinations such as “Aa” are not considered palindromes.

Constraints:

  • 11 \leq s.length 103\leq 10^3

  • s consists of lowercase and/or uppercase English letters only.

Examples

Create a free account to view this lesson.

Continue your learning journey with a 14-day free trial.

By signing up, you agree to Educative's Terms of Service and Privacy Policy