## 문제

n개의 단어가 주어지면 짧은것부터, 그다음 사전순으로 정렬해야 한다.

중복된것도 제거해야하는데 set로 바꾼다음 다시 list로 바꾸면 간단하게 된다.


## code

import sys
input = sys.stdin.readlines()
n1 = list(map(lambda x:x.rstrip(),input[1:]))
n2 = list(map(lambda x:x.replace('\x1a',''),n1))
n3 = list(set(n2))
l = []
for tmp in n3:
a = len(tmp)
l += [[a,tmp]]
l.sort()
for tmp in l:
print(tmp[1])
view raw boj1181.py hosted with ❤ by GitHub