← Back to List

15237번: Cipher ↗

Solutions

Python 3
240 B | 240 chars
n,m = map(int,input().split())
L = list(map(int,input().split()))
d = {}
for i in L:
    try:
        d[i]+=1
    except:
        d[i] =1

L = list(d.items())
L.sort(key = lambda t : -t[1])
for i in L:
    print((str(i[0])+" ")*i[1],end="")