Skip to content

Commit 789c357

Browse files
committed
[level 2] Title: [3차] 압축, Time: 0.46 ms, Memory: 9.31 MB -BaekjoonHub
1 parent ca46acf commit 789c357

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

프로그래머스/2/17684. [3차] 압축/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
### 성능 요약
66

7-
메모리: 9.98 MB, 시간: 0.80 ms
7+
메모리: 9.31 MB, 시간: 0.46 ms
88

99
### 구분
1010

@@ -16,7 +16,7 @@
1616

1717
### 제출 일자
1818

19-
2025년 01월 09일 11:38:35
19+
2025년 12월 28일 16:32:55
2020

2121
### 문제 설명
2222

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
def solution(msg):
2-
answer = []
3-
dic = {chr(i + 64): i for i in range(1, 27)}
4-
2+
ans = []
3+
dic = {chr(65+i):i+1 for i in range(26)}
4+
55
w = c = 0
66
while True:
7-
c += 1
8-
if c == len(msg):
9-
answer.append((dic[msg[w:c]]))
7+
c += 1
8+
if c == len(msg):
9+
ans.append(dic[msg[w:c]])
1010
break
1111

1212
if msg[w:c+1] not in dic:
1313
dic[msg[w:c+1]] = len(dic) + 1
14-
answer.append(dic[msg[w:c]])
14+
ans.append(dic[msg[w:c]])
1515
w = c
16-
return answer
16+
return ans

0 commit comments

Comments
 (0)