Skip to content

Commit 982d6ea

Browse files
authored
Merge pull request #130 from front-studium/Insung-Jo
`week29` 문제 완료
2 parents 1f97740 + c0e12e3 commit 982d6ea

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
function solution(array) {
2+
const answer = [Math.max(...array), array.indexOf(Math.max(...array))];
3+
4+
return answer;
5+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
function solution(n) {
2+
const answer = [];
3+
let count = 1;
4+
5+
while (n >= count) {
6+
if (n % count === 0) {
7+
answer.push(count);
8+
}
9+
10+
count++;
11+
}
12+
13+
return answer.sort((a, b) => a - b);
14+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
function solution(arr) {
2+
let answer = 0;
3+
4+
for (const i of arr) {
5+
answer += i;
6+
}
7+
8+
return answer / arr.length;
9+
}

0 commit comments

Comments
 (0)