Longest Palindrome
Last updated
Was this helpful?
Last updated
Was this helpful?
Given a string s
which consists of lowercase or uppercase letters, return the length of the longest palindrome that can be built with those letters.
Letters are case sensitive, for example, "Aa"
is not considered a palindrome here.
Time: O(n)
Space: O(1) because the hash set is bounded by 26 characters