Given a string which consists of lowercase or uppercase letters, find the length of the longest palindromes that can be built with those letters.
This is case sensitive, for example "Aa"
is not considered a palindrome here.
Note:
Assume the length of given string will not exceed 1,010.
Example:
Input: "abccccdd" Output: 7 Explanation: One longest palindrome that can be built is "dccaccd", whose length is 7.
# -*- coding:utf-8 -*-
__author__ = 'yangxin_ryan'
import collections
"""
Solutions:
统计最大的组合回文,这里可以使用统计字母的方法,
例如:
1.若字母出现偶数次,则直接累加值最终结果
2.若字母出现奇数次,则-1后再累加值最终结果
"""
class LongestPalindrome(object):
def longestPalindrome(s