Light Mode
Dark Mode
Code works but doesn't get pass the 'check'
def  f(x) :
    if len(x) >10e5 :
        return 'sentence is extremely long'     
    x=x.lower()
    l=[] 
    d={} 
    for u in x:
        if u in 'aqwertyuioplkjhgfdszxcvbnm' :
            l.append(u)
            d[u] =0
    for i in l :
        d[i] +=1
    a=[[i, d[i]] for i in d]   
    a.sort(key=lambda x:x[1], reverse=True)
    for i in a:
        return i[0]

It works with all the assert statements but doesn't get pass the check Please fix

Created: April 22, 2019, 2:27 p.m.
Updated: April 25, 2019, 12:13 a.m.
0
4
User avatar
Kofi_Otuo