Skip to content

[Week 7] 황주희 #28

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

[Week 7] 황주희 #28

wants to merge 2 commits into from

Conversation

Juhee-Hwang
Copy link
Contributor

✨ 푼 문제

  • 모의고사 Lv.1

✨ 모의고사 솔루션 추가
⚙️ 프로그래머스 문제 표기
@Juhee-Hwang Juhee-Hwang self-assigned this Jun 1, 2022
Copy link
Contributor

@Happhee Happhee left a comment

Choose a reason for hiding this comment

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

주석 너무 귀엽자나ㅠㅠㅠㅠㅠㅠ흑

Comment on lines +2 to +7
let answer = [];

let score = [ 0, 0, 0]
let supo1 = [1,2,3,4,5]
let supo2 = [2,1,2,3,2,4,2,5]
let supo3 = [3,3,1,1,2,2,4,4,5,5]
Copy link
Contributor

@Happhee Happhee Jun 8, 2022

Choose a reason for hiding this comment

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

요런 배열은 const로 선언하는게 조아여!!! 안전하게~.~

그른데 이제 제안할수 있는거느은 supo1,supo2, supo3보다는 supo로 하나의 배열 사용해서 이차원 쓸수도 있다아~.~

let supo3 = [3,3,1,1,2,2,4,4,5,5]


for (var i = 0; i < answers.length; i++){
Copy link
Contributor

Choose a reason for hiding this comment

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

var는 지양해주세여!! let 고고!!

}
}

let max_score = Math.max(...score)
Copy link
Contributor

Choose a reason for hiding this comment

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

변수이름은 !! lowerCamelCase 로!
maxScore

요기서는 값이 변하지 않으니까 const로 쓰면 데게쮸?!

Comment on lines +11 to +23
if (supo1[i] === answers[i]) score[0]++
if (supo2[i] === answers[i]) score[1]++
if (supo3[i] === answers[i]) score[2]++

if (i > supo1.length-1) {
if(supo1[i%supo1.length] === answers[i]) score[0]++
}
if (i > supo2.length-1) {
if(supo2[i%supo2.length] === answers[i]) score[1]++
}
if (i > supo3.length-1) {
if(supo3[i%supo3.length] === answers[i]) score[2]++
}
Copy link
Contributor

Choose a reason for hiding this comment

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

그렇게 되면 요기 코드 반복되는 부분들을 줄일 수도 있겟져?!

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