-
Notifications
You must be signed in to change notification settings - Fork 98
etc: level-0 파일 추가 #108
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
Open
etc: level-0 파일 추가 #108
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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
11 changes: 11 additions & 0 deletions
level-0/00-해답-예시.js
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
//https://github.com/codeisneverodd/programmers-coding-test | ||
//더 좋은 풀이가 존재할 수 있습니다. | ||
//정답 1 - 본인의 깃허브 아이디 | ||
function solution(n) { | ||
//프로그래머스에 제출하여 통과된 함수를 복사 붙여넣기 해주세요! | ||
} | ||
|
||
//정답 2 - 본인의 깃허브 아이디 | ||
function solution(n) { | ||
//정답을 다른 방법으로도 작성했다면 추가해 주세요! | ||
} |
10 changes: 10 additions & 0 deletions
level-0/n의-배수-고르기.js
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
//https://github.com/codeisneverodd/programmers-coding-test | ||
//더 좋은 풀이가 존재할 수 있습니다. | ||
//정답 1 - jetom88 | ||
function solution(n, numlist) { | ||
let result = []; | ||
for (let i = 0; i < numlist.length; i++) { | ||
if (numlist[i] % n === 0) result.push(numlist[i]); | ||
} | ||
return result; | ||
} |
15 changes: 15 additions & 0 deletions
level-0/가위-바위-보.js
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
//https://github.com/codeisneverodd/programmers-coding-test | ||
//더 좋은 풀이가 존재할 수 있습니다. | ||
//정답 1 - jetom88 | ||
function solution(rsp) { | ||
const str = rsp.split(''); | ||
let result = []; | ||
|
||
for (let i = 0; i < str.length; i++) { | ||
if (str[i] === '2') result.push('0'); | ||
else if (str[i] === '0') result.push('5'); | ||
else result.push('2'); | ||
} | ||
|
||
return result.join(''); | ||
} |
10 changes: 10 additions & 0 deletions
level-0/배열-두-배-만들기.js
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
//https://github.com/codeisneverodd/programmers-coding-test | ||
//더 좋은 풀이가 존재할 수 있습니다. | ||
//정답 1 - jetom88 | ||
function solution(numbers) { | ||
let result = []; | ||
for (let i = 0; i < numbers.length; i++) { | ||
result.push(numbers[i] * 2); | ||
} | ||
return result; | ||
} |
12 changes: 12 additions & 0 deletions
level-0/배열-원소의-길이.js
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
//https://github.com/codeisneverodd/programmers-coding-test | ||
//더 좋은 풀이가 존재할 수 있습니다. | ||
//정답 1 - jetom88 | ||
function solution(strlist) { | ||
let result = []; | ||
|
||
for (let i = 0; i < strlist.length; i++) { | ||
result.push(strlist[i].length); | ||
} | ||
|
||
return result; | ||
} |
6 changes: 6 additions & 0 deletions
level-0/배열의-평균값.js
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
//https://github.com/codeisneverodd/programmers-coding-test | ||
//더 좋은 풀이가 존재할 수 있습니다. | ||
//정답 1 - jetom88 | ||
function solution(numbers) { | ||
return numbers.reduce((acc, cur) => acc + cur) / numbers.length; | ||
} |
12 changes: 12 additions & 0 deletions
level-0/숨어있는-숫자의-덧셈-(1).js
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
//https://github.com/codeisneverodd/programmers-coding-test | ||
//더 좋은 풀이가 존재할 수 있습니다. | ||
//정답 1 - jetom88 | ||
function solution(my_string) { | ||
const num = my_string.split(''); | ||
let result = 0; | ||
|
||
for (let i = 0; i < num.length; i++) { | ||
if (Number(num[i])) result += Number(num[i]); | ||
} | ||
return result; | ||
} |
11 changes: 11 additions & 0 deletions
level-0/약수-구하기.js
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
//https://github.com/codeisneverodd/programmers-coding-test | ||
//더 좋은 풀이가 존재할 수 있습니다. | ||
//정답 1 - jetom88 | ||
function solution(n) { | ||
let result = []; | ||
|
||
for (let i = 1; i <= n; i++) { | ||
if (n % i === 0) result.push(i); | ||
} | ||
return result; | ||
} |
6 changes: 6 additions & 0 deletions
level-0/양꼬치.js
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
//https://github.com/codeisneverodd/programmers-coding-test | ||
//더 좋은 풀이가 존재할 수 있습니다. | ||
//정답 1 - jetom88 | ||
function solution(n, k) { | ||
return n * 12000 + (k * 2000 - Math.floor(n / 10) * 2000); | ||
} |
11 changes: 11 additions & 0 deletions
level-0/자릿수-더하기.js
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
//https://github.com/codeisneverodd/programmers-coding-test | ||
//더 좋은 풀이가 존재할 수 있습니다. | ||
//정답 1 - jetom88 | ||
function solution(n) { | ||
const str = String(n).split(''); | ||
let number = 0; | ||
|
||
str.map(num => (number += Number(num))); | ||
|
||
return number; | ||
} |
8 changes: 8 additions & 0 deletions
level-0/중복된-숫자-개수.js
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
//https://github.com/codeisneverodd/programmers-coding-test | ||
//더 좋은 풀이가 존재할 수 있습니다. | ||
//정답 1 - jetom88 | ||
function solution(array, n) { | ||
const result = array.filter(num => num === n); | ||
|
||
return result.length; | ||
} |
15 changes: 15 additions & 0 deletions
level-0/짝수-홀수-개수.js
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
//https://github.com/codeisneverodd/programmers-coding-test | ||
//더 좋은 풀이가 존재할 수 있습니다. | ||
//정답 1 - jetom88 | ||
function solution(num_list) { | ||
const even = []; | ||
|
||
const oddNumber = []; | ||
|
||
let result = []; | ||
for (let i = 0; i < num_list.length; i++) { | ||
if (num_list[i] % 2 === 0) even.push(num_list[i]); | ||
else oddNumber.push(num_list[i]); | ||
} | ||
return (result = [even.length, oddNumber.length]); | ||
} |
11 changes: 11 additions & 0 deletions
level-0/짝수는-싫어요.js
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
//https://github.com/codeisneverodd/programmers-coding-test | ||
//더 좋은 풀이가 존재할 수 있습니다. | ||
//정답 1 - jetom88 | ||
function solution(n) { | ||
let result = []; | ||
for (let i = 1; i <= n; i++) { | ||
if (i % 2 === 1) result.push(i); | ||
} | ||
|
||
return result; | ||
} |
12 changes: 12 additions & 0 deletions
level-0/최댓값-만들기(1).js
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
//https://github.com/codeisneverodd/programmers-coding-test | ||
//더 좋은 풀이가 존재할 수 있습니다. | ||
//정답 1 - jetom88 | ||
function solution(numbers) { | ||
let findNum = []; | ||
|
||
for (let i = 0; i < numbers.length - 1; i++) { | ||
findNum.push(numbers[i] * numbers[i + 1]); | ||
} | ||
const max = Math.max(...findNum); | ||
return max; | ||
} |
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.