• What is wrong?

Question related to mission The Most Wanted Letter

 

I don`t undestand where my mistake?

CODE:

def func(text):

t = text.lower()
a = ''

for i in t:
    if i.isalpha():
        a += i
dct = {}

for i in a:
    if i in dct:
        dct[i] += 1
    else:
        dct[i] = 1
count = 0
for i in dct:
    if dct[i] == 1:
        count += 1

b = (list(dct.items()))
c = sorted(b, key = lambda x: (x[-1], x[0]))

if count == len(dct):
    return sorted(text)[0]
else:
    return c[-1][0]