- Notifications
You must be signed in to change notification settings - Fork 97
[풀이 추가] 2022.04.15 8문제 추가 #32
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
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits Select commit Hold shift + click to select a range
52e1a21 Add 소수-찾기.js
chaerin-dev ad54a6a Add 문자열-다루기-기본.js
chaerin-dev b56e2c9 Add 문자열-내림차순으로-배치하기.js
chaerin-dev a9db3b3 Add 문자열-내-p와-y의-개수.js
chaerin-dev ed81e2b Add 문자열-내-마음대로-정렬하기.js
chaerin-dev ee60a08 Add 나누어-떨어지는-숫자-배열.js
chaerin-dev 8f5217f Add 같은-숫자는-싫어.js
chaerin-dev 163ec45 Add 가운데-글자-가져오기.js
chaerin-dev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| | @@ -17,4 +17,13 @@ function solution(arr, divisor) { | |
| answer.length === 0 ? answer.push(-1) : null | ||
| answer.sort((a, b) => a - b) | ||
| return answer; | ||
| } | ||
| | ||
| //정답 3. chaerin-dev | ||
| function solution(arr, divisor) { | ||
| let answer = []; | ||
| arr.forEach((e) => { | ||
| if (e % divisor === 0) answer.push(e); | ||
| }); | ||
| Owner There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 24-27 라인이 Contributor Author There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 그러네요!! filter 메서드가 익숙하지 않아서 떠올리지 못했는데, filter를 사용하면 가독성도 좋고 훨씬 간결한 코드가 되겠네요. 감사합니다!! 👍👍👍 | ||
| return answer.length ? answer.sort((a, b) => a - 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
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
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
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
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
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.
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.
filter에 대한 간략한 설명을 적어주셔서 처음 보시는 분들도 이해하기 좋을 것 같습니다 👍