-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
권해정 / 17주차 #24
base: main
Are you sure you want to change the base?
권해정 / 17주차 #24
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
주제가 익숙하지 않아서 어려웠지만 고생한 만큼 다음엔 더 수월하게 푸실 수 있을 것 같아요! 이번 주도 수고하셨습니다..!
@@ -0,0 +1,45 @@ | |||
const input = require("fs").readFileSync("/dev/stdin").toString().trim().split("\n"); | |||
const num = Number(input.shift()); | |||
const ds = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
방향을 변수 하나로 선언하는 방법도 좋네요
}; | ||
|
||
let maxCount = 0; | ||
for (let height = 0; height <= 100; height++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
높이가 1 이상이라 초기값을 1로 두어도 괜찮을 것 같습니다 저도 0부터 시작했지만..😌
} | ||
for (let i = 0; i < num; i++) { | ||
let worm = 0; | ||
var [M, N, K] = input.shift().split(" ").map(Number); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
첫 번째 요소를 없애기 위해 shift()를 써도 되는군요!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
수고하셨습니다!
}); | ||
|
||
const dfs = (start) => { | ||
const stack = [start]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
덕분에 스택으로 구현하는 방법도 있다는거 알았네요!
// 9655: 돌 게임 | ||
|
||
const input = require("fs").readFileSync("/dev/stdin").toString().trim().split("\n").map(Number); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
입력 부분이 깔끔하네요! 전 여기서 변수 3개를 선언해서 하고 있었는데.. 배우고 갑니다.
// 1904: 타일 | ||
const input = require("fs").readFileSync("/dev/stdin").toString().trim().split("\n").map(Number); | ||
const memo = Array.from({ length: input }, () => 0); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new Array와 Array.from을 어떤 경우에 구분해서 사용하시는지 궁금합니다👀
No description provided.