Tap here to switch tabs
Problem
Ask
Submissions

Problem: Longest Palindrome

easy
15 min
Explore how to determine the length of the longest palindrome that can be formed from a given string containing case-sensitive letters. This lesson guides you through understanding the problem constraints, leveraging hash maps for efficient counting, and implementing an optimal O(n) time solution. You will gain skills to solve palindrome-related coding challenges and practice problem-solving with hands-on coding exercises.

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.

Tap here to switch tabs
Problem
Ask
Submissions

Problem: Longest Palindrome

easy
15 min
Explore how to determine the length of the longest palindrome that can be formed from a given string containing case-sensitive letters. This lesson guides you through understanding the problem constraints, leveraging hash maps for efficient counting, and implementing an optimal O(n) time solution. You will gain skills to solve palindrome-related coding challenges and practice problem-solving with hands-on coding exercises.

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.