Skip to content

Commit

Permalink
comment : 오큰수
Browse files Browse the repository at this point in the history
  • Loading branch information
luckylooky2 committed Oct 3, 2023
1 parent 3464225 commit 75b8ebb
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
3 changes: 1 addition & 2 deletions baekjoon/17298.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// 오큰수
// 오큰수 : 스택
const input = require("fs")
.readFileSync("/dev/stdin")
.toString()
Expand All @@ -8,7 +8,6 @@ const input = require("fs")
const [n] = input.shift();
const arr = input.shift();
const answer = [];

const stack = [];
const reversed = arr.reverse();
reversed.map((v, i) => {
Expand Down
7 changes: 0 additions & 7 deletions baekjoon/3190.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,3 @@ while (true) {
}

console.log(second);

// 실수했던 부분 : 사과 위치가 [0, 0] 기준이 아니라 [1, 1] 기준
// 사과를 먹으면 사과를 0으로 교체
// snake를 순회할 때, 배열처럼 접근하여 로직이 이상해졌음
// break가 전체 loop break가 아니었음
// currDir에서 바뀌기 전의 값으로 비교했었어야 하는데(0, 3) => (0, 5)로 비교
// push_front(), pop_back()만 사용하므로 큐를 거꾸로 사용하면 큐만 사용할 수 있음

0 comments on commit 75b8ebb

Please sign in to comment.