Skip to content
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

upload week1 #6

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

upload week1 #6

wants to merge 1 commit into from

Conversation

su-lim
Copy link
Contributor

@su-lim su-lim commented Dec 15, 2022

week1 업로드합니다

Copy link
Collaborator

@heroleggo heroleggo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

코테준비 화이팅!

const n =+input[0];
const numberList = input[1].split(" ").map((e) => +e);

function main(N, numberList) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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];
})
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

compare function을 하나로 적으면 더 간단해질 것 같아요. (대충 로직은 알고 있을 거라고 생각하니까 arrow function 형태로 적었습니다.)

const compareFunction = (a, b) => (a[0] - b[0] !== 0 ? a[0] - b[0] : a[1] - b[1])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants