Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 63d4698

Browse files
committed
refac: 3차 압축 풀이 리팩토링
1 parent 0b6dc68 commit 63d4698

File tree

1 file changed

+1
-28
lines changed

1 file changed

+1
-28
lines changed

‎level-2/[3차]-압축&17684&.js‎

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -35,34 +35,7 @@ function solution(msg) {
3535
// 정답 2 - ssi02014
3636
function solution(msg) {
3737
const result = [];
38-
const dict = [
39-
"A",
40-
"B",
41-
"C",
42-
"D",
43-
"E",
44-
"F",
45-
"G",
46-
"H",
47-
"I",
48-
"J",
49-
"K",
50-
"L",
51-
"M",
52-
"N",
53-
"O",
54-
"P",
55-
"Q",
56-
"R",
57-
"S",
58-
"T",
59-
"U",
60-
"V",
61-
"W",
62-
"X",
63-
"Y",
64-
"Z",
65-
];
38+
const dict = Array.from({length: 26},(_, i) => String.fromCharCode(65 + i))
6639

6740
// 시간 복잡도 O(N^2)
6841
const lastWordAndCompression = msg.split("").reduce((acc, cur) => {

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /