Skip to content

Commit f5b14bb

Browse files
authored
Merge pull request #66 from front-studium/Insung-Jo
`week11` `week12` `week13` `week14` 풀었습니다
2 parents 6ff4cf7 + a694e68 commit f5b14bb

File tree

8 files changed

+56
-0
lines changed

8 files changed

+56
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
function solution(my_string) {
2+
return my_string.split("").reverse().join("");
3+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
function solution(my_string, n) {
2+
let answer = my_string.split("");
3+
let result = [];
4+
5+
for (let i = 0; i < answer.length; i++) {
6+
result = answer[i];
7+
for (let j = 0; j < n - 1; j++) {
8+
answer[i] += result;
9+
}
10+
}
11+
let num1 = answer.join("");
12+
13+
return num1;
14+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
function solution(num_list) {
2+
return num_list.reverse();
3+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
function solution(numbers) {
2+
let sum = 0;
3+
numbers.forEach((number) => (sum += number));
4+
const result = sum / numbers.length;
5+
return result;
6+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
function solution(n) {
2+
const result = Math.sqrt(n);
3+
4+
if (n % result === 0) return 1;
5+
return 2;
6+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
function solution(num_list) {
2+
var answer = num_list;
3+
const even = answer.filter((num) => num % 2 === 0).length;
4+
const odd = answer.filter((num) => num % 2 === 1).length;
5+
6+
const result = [even, odd];
7+
8+
return result;
9+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
function solution(my_string, letter) {
2+
let answer = my_string.split("");
3+
4+
for (let i = 0; i < answer.length; i++) {
5+
if (answer[i] === letter) {
6+
answer.splice(i, 1);
7+
i--;
8+
}
9+
}
10+
answer = answer.join("");
11+
return answer;
12+
}

Insung-Jo/level_0/편지.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
function solution(message) {
2+
return message.length * 2;
3+
}

0 commit comments

Comments
 (0)