Open
Conversation
heroleggo
reviewed
Dec 20, 2022
| const n =+input[0]; | ||
| const numberList = input[1].split(" ").map((e) => +e); | ||
|
|
||
| function main(N, numberList) { |
Collaborator
There was a problem hiding this comment.
main으로 구분지어 주는 것도 좋아보이네요. 대부분의 코테 플랫폼도 solution 형태로 코드를 작성하도록 되어있다보니 연습도 할 겸 좋은 것 같아요!
Comment on lines
+16
to
+21
| timeList.sort(function(a,b){ | ||
| return a[0] - b[0]; | ||
| }) | ||
| timeList.sort(function(a,b){ | ||
| return a[1] - b[1]; | ||
| }) |
Collaborator
There was a problem hiding this comment.
compare function을 하나로 적으면 더 간단해질 것 같아요. (대충 로직은 알고 있을 거라고 생각하니까 arrow function 형태로 적었습니다.)
const compareFunction = (a, b) => (a[0] - b[0] !== 0 ? a[0] - b[0] : a[1] - b[1])
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
week1 업로드합니다