Tap here to switch tabs
Problem
Submissions

Problem: Longest Palindrome

Longest Palindrome asks for the maximum length of a palindrome that can be formed by rearranging letters from a case-sensitive string, with each letter used at most once.

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:

  • 1≤1 \leq s.length ≤103\leq 10^3

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

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Longest Palindrome

Longest Palindrome asks for the maximum length of a palindrome that can be formed by rearranging letters from a case-sensitive string, with each letter used at most once.

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:

  • 1≤1 \leq s.length ≤103\leq 10^3

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