Skip to content

Commit 1e00771

Browse files
committed
[BOJ] 1181 단어 정렬 (S5)
1 parent 7c13da0 commit 1e00771

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

심수연/1주차/.cph/.260102.py_c216b2fe4d8c84863a6292ea2f08503c.prob

Lines changed: 0 additions & 1 deletion
This file was deleted.

심수연/2주차/260105.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import sys
2+
input = sys.stdin.readline
3+
4+
N = int(input())
5+
6+
words = []
7+
8+
for i in range(N):
9+
words.append(input().strip())
10+
11+
words = list(set(words)) # 중복 제거 후 list로 감싸기
12+
words.sort(key=lambda x:(len(x), x)) # 튜플로 두 가지 기준 비교. 1. 길이순 + 2. 알파벳순
13+
14+
for i in range(len(words)):
15+
print(words[i])
16+

0 commit comments

Comments
 (0)