Skip to content

Commit 2c30414

Browse files
authored
#14 : 1431_시리얼 번호
#14 : Week3_예원이티
1 parent 3902c53 commit 2c30414

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import sys
2+
3+
n = int(sys.stdin.readline())
4+
5+
guitar = []
6+
7+
for _ in range(n):
8+
guitar.append(sys.stdin.readline().strip())
9+
10+
def serialSum(str):
11+
sum = 0
12+
for i in str:
13+
if i.isdigit():
14+
sum += int(i)
15+
return sum
16+
17+
guitar.sort(key = lambda x : (len(x), serialSum(x), x))
18+
19+
for a in guitar:
20+
print(a)

0 commit comments

Comments
 (0)