-
Notifications
You must be signed in to change notification settings - Fork 17
[6주차][이진 탐색][호준] 학습하고 있는 내용 정리 #60
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
base: ganeodolu
Are you sure you want to change the base?
Conversation
src/C5 이진탐색/P02 JS3 떡볶이 떡 만들기.js
Outdated
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.
| arr.forEach((val) => { | |
| if (val > mid) { | |
| total += val - mid; | |
| } | |
| }); | |
| const total = arr.reduce((acc, val) => acc + Math.max(0, val - mid), 0); |
검증은 못해봤는데, reduce 로 줄여서 쓸 수도 있을거 같아요 😄
src/C5 이진탐색/P02 JS3 떡볶이 떡 만들기.js
Outdated
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 N = 4, | |
| M = 6; | |
| const N = 4; | |
| const M = 6; |
const 하나당 하나의 식별자만 선언하는게 더 명시적이고 직관적인거 같은데, 어떻게 생각하시나욤~~
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.
동의합니다. 이런 형식으로도 가능하다 라는 마음으로 사용해봤습니다 😄
src/C5 이진탐색/P02 JS3 떡볶이 떡 만들기.js
Outdated
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.
dduk ㅋㅋㅋㅋㅋㅋㅋㅋㅋ
[6주차][이진 탐색][호준] 학습하고 있는 내용 정리
Q29는 문제가 잘 이해 안돼서 답 보고 풀었습니다. 다른 분들은 잘 푸셨는지 궁금해요 😓