Longest Palindrome

Given a string s with lowercase and/or uppercase letters, return the length of the longest palindrome that can be constructed using those letters. Letters are case sensitive, thus 'Aa' is not considered a palindrome.

Constraints

  • 1 <= s.length <= 2000
  • s consists of lowercase and/or uppercase English letters only.
Saving… · 2 lines
class Solution:
def longestPalindrome(self, s: str) -> int:
Console

Click Run to execute sample tests.