Skip to content

Commit e718649

Browse files
authored
Merge pull request #112 from front-studium/Insung-Jo
`week23` 문제 완료
2 parents 5fe995d + d5f00b0 commit e718649

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
function solution(array) {
2+
const answer = array.sort((a, b) => a - b);
3+
const num = Math.floor(answer.length / 2);
4+
5+
return answer[num];
6+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
function solution(n) {
2+
let answer = [];
3+
4+
for (let i = 0; i <= n; i++) {
5+
if (i % 2 !== 0) {
6+
answer.push(i);
7+
}
8+
}
9+
return answer;
10+
}

0 commit comments

Comments
 (0)