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 7eed594

Browse files
Merge pull request codeisneverodd#100 from codeisneverodd/codeisneverodd
feat: 레벨 이동 및 전체 문제 수 변경
2 parents 2018130 + de5a0c3 commit 7eed594

File tree

4 files changed

+27
-27
lines changed

4 files changed

+27
-27
lines changed
File renamed without changes.
File renamed without changes.

‎level-3/이중우선순위큐.js

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,31 @@
44
function solution(operations) {
55
var answer = [];
66
for (let i = 0; i < operations.length; i++) {
7-
8-
// 숫자 삽입
9-
if(operations[i][0]=='I'){
10-
letm=operations[i].substring(2,operations[i].length)
11-
answer.push(m)
12-
}
13-
// if 최댓값 삭제
14-
elseif(operations[i][0]=='D'&&operations[i][2]=='1'&&operations.length>0){
15-
answer.pop()
16-
}
17-
// if 최솟값 삭제
18-
elseif(operations[i][0]=='D'&&operations[i][2]=='-'&&operations[i][3]=='1'&&operations.length>0){
19-
20-
answer.shift()
21-
}
22-
23-
answer.sort((a,b)=>{returna-b});
7+
// 숫자 삽입
8+
if(operations[i][0]=='I'){
9+
letm=operations[i].substring(2,operations[i].length);
10+
answer.push(m);
11+
}
12+
// if 최댓값 삭제
13+
elseif(operations[i][0]=='D'&&operations[i][2]=='1'&&operations.length>0){
14+
answer.pop();
15+
}
16+
// if 최솟값 삭제
17+
elseif(operations[i][0]=='D'&&operations[i][2]=='-'&&operations[i][3]=='1'&&operations.length>0){
18+
answer.shift();
19+
}
20+
21+
answer.sort((a,b)=>{
22+
returna-b;
23+
});
2424
}
25-
if (answer.length == 0) return [0, 0]
25+
if (answer.length == 0) return [0, 0];
2626
else {
27-
return [parseInt(answer.pop()), parseInt(answer.shift())];
28-
}
27+
return [parseInt(answer.pop()), parseInt(answer.shift())];
28+
}
2929
}
3030
/* 풀이 과정
3131
1. 연산 처리를 구별하기 위해 배열의 0번째 자리, 2번째 자리에 있는 등을 비교하여 조건에 따른 명령을 실행한다.
3232
2. answer 배열을 정렬 해준다
3333
3. 큐가 비어있으면 ( length == 0 ) 0을 반환. , 그렇지 않으면 [최댓값, 최솟값]을 반환한다.
34-
*/
34+
*/

‎utils/build.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,16 @@ const updateData = `# 프로그래머스 모든 문제 풀이
3232
3333
### Level 1 ✅
3434
35-
- 전체 문제 수: 57문제
35+
- 전체 문제 수: 57문제(레벨 변동에 따라 차이가 있을 수 있습니다)
3636
- 풀이 문제 수: ${getInfoList(1).length}문제
3737
3838
| 번호 | 문제 출처 | 풀이 |
3939
| --- | ------- | --- |
4040
${getTableStr(1)}
4141
42-
### Level 2 👨🏻‍💻(풀이 중..)
42+
### Level 2
4343
44-
- 전체 문제 수: 70문제
44+
- 전체 문제 수: 72문제(레벨 변동에 따라 차이가 있을 수 있습니다)
4545
- 풀이 문제 수: ${getInfoList(2).length}문제
4646
4747
| 번호 | 문제 출처 | 풀이 |
@@ -50,7 +50,7 @@ ${getTableStr(2)}
5050
5151
### Level 3 👨🏻‍💻(풀이 중..)
5252
53-
- 전체 문제 수: 52문제
53+
- 전체 문제 수: 51문제(레벨 변동에 따라 차이가 있을 수 있습니다)
5454
- 풀이 문제 수: ${getInfoList(3).length}문제
5555
5656
| 번호 | 문제 출처 | 풀이 |
@@ -59,7 +59,7 @@ ${getTableStr(3)}
5959
6060
### Level 4
6161
62-
- 전체 문제 수: 22문제
62+
- 전체 문제 수: 19문제(레벨 변동에 따라 차이가 있을 수 있습니다)
6363
- 풀이 문제 수: ${getInfoList(4).length}문제
6464
6565
| 번호 | 문제 출처 | 풀이 |
@@ -68,7 +68,7 @@ ${getTableStr(4)}
6868
6969
### Level 5
7070
71-
- 전체 문제 수: 6문제
71+
- 전체 문제 수: 6문제(레벨 변동에 따라 차이가 있을 수 있습니다)
7272
- 풀이 문제 수: ${getInfoList(5).length}문제
7373
7474
| 번호 | 문제 출처 | 풀이 |

0 commit comments

Comments
(0)

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