Problem
Ask
Submissions

Problem: Longest Palindrome

Easy
15 min
Explore how to determine the length of the longest palindrome that can be formed from given letters, focusing on case sensitivity and using hash maps. Learn to approach this problem with an efficient O(n) time and space solution, strengthening your coding interview skills.

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

Easy
15 min
Explore how to determine the length of the longest palindrome that can be formed from given letters, focusing on case sensitivity and using hash maps. Learn to approach this problem with an efficient O(n) time and space solution, strengthening your coding interview skills.

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.