📅  最后修改于: 2022-03-11 14:52:47.408000             🧑  作者: Mango
def anagram(str,k):
anag={}
for i in str:
if (i==’a’ or i==’b’ or i==’c’) == False:
return 0
if i not in anag.keys():
anag[i]=0
anag[i]=anag[i]+1
U_index=max(anag.values())
l=len(str)
l=l-U_index
if k<=l:
U_index+=k
else:
U_index+=l
print(U_index)
anagram(input(),int(input()))