class Solution:
"""
@param str: the str
@return: the letter
"""
'''
大致思路:
1.while str != '',每次取出最大值,然后判断该最大值的.upper(),是否存在str,如果存在,则返回该最大值.upper()。否则的话,返回~
'''
def findLetter(self,str):
while str != '':
max_s = max(str)
if max_s.upper() in str and max_s.lower() in str:
return max_s.upper()
str = str.replace(max_s,'')
return'~'