Problem
Ask
Submissions

Problem: Longest Palindrome

Medium
30 min
Explore how to determine the longest palindrome length that can be built from a given case-sensitive string using hash maps. Understand the problem constraints and apply an optimal O(n) time and space solution. This lesson will help you develop coding skills to handle palindromes in interview questions efficiently.

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.

Problem
Ask
Submissions

Problem: Longest Palindrome

Medium
30 min
Explore how to determine the longest palindrome length that can be built from a given case-sensitive string using hash maps. Understand the problem constraints and apply an optimal O(n) time and space solution. This lesson will help you develop coding skills to handle palindromes in interview questions efficiently.

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.