[6주차][이진 탐색][호준] 학습하고 있는 내용 정리#60
Open
ganeodolu wants to merge 4 commits intofe-backpackers:ganeodolufrom
Open
[6주차][이진 탐색][호준] 학습하고 있는 내용 정리#60ganeodolu wants to merge 4 commits intofe-backpackers:ganeodolufrom
ganeodolu wants to merge 4 commits intofe-backpackers:ganeodolufrom
Conversation
bigsaigon333
reviewed
Nov 7, 2021
src/C5 이진탐색/P02 JS3 떡볶이 떡 만들기.js
Outdated
Comment on lines
+6
to
+10
Contributor
There was a problem hiding this comment.
Suggested change
| arr.forEach((val) => { | |
| if (val > mid) { | |
| total += val - mid; | |
| } | |
| }); | |
| const total = arr.reduce((acc, val) => acc + Math.max(0, val - mid), 0); |
검증은 못해봤는데, reduce 로 줄여서 쓸 수도 있을거 같아요 😄
bigsaigon333
reviewed
Nov 7, 2021
src/C5 이진탐색/P02 JS3 떡볶이 떡 만들기.js
Outdated
Comment on lines
+28
to
+29
Contributor
There was a problem hiding this comment.
Suggested change
| const N = 4, | |
| M = 6; | |
| const N = 4; | |
| const M = 6; |
const 하나당 하나의 식별자만 선언하는게 더 명시적이고 직관적인거 같은데, 어떻게 생각하시나욤~~
Author
There was a problem hiding this comment.
동의합니다. 이런 형식으로도 가능하다 라는 마음으로 사용해봤습니다 😄
bigsaigon333
reviewed
Nov 7, 2021
src/C5 이진탐색/P02 JS3 떡볶이 떡 만들기.js
Outdated
Author
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.
[6주차][이진 탐색][호준] 학습하고 있는 내용 정리
Q29는 문제가 잘 이해 안돼서 답 보고 풀었습니다. 다른 분들은 잘 푸셨는지 궁금해요 😓