Skip to content

Commit 059a2b2

Browse files
committed
알고리즘 풀 업데이트
1 parent 9d05292 commit 059a2b2

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

part1/1.세자리곱셈.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
let fs = require("fs")
2+
let input = fs.readFileSync("input.txt").toString().split("\n")
3+
4+
const leftNumber=Number(input[0])
5+
6+
const a= Number(input[1].split("")[2])
7+
const b= Number(input[1].split("")[1])
8+
const c= Number(input[1].split("")[0])
9+
10+
11+
console.log(leftNumber*a)
12+
console.log(leftNumber*b)
13+
console.log(leftNumber*c)
14+
console.log(leftNumber*a+leftNumber*b*10+leftNumber*c*100)

섹션8/9.동전교환.html

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,12 @@
1212
if (sum > m) return;
1313

1414
if (L >= answer) return;
15-
1615
if (sum === m) {
17-
// answer = Math.min(answer, L);
16+
answer = Math.min(answer, L);
1817
} else {
19-
// for (let i = 0; i < n; i++) {
20-
// DFS(L + 1, sum + arr[i]);
21-
// }
18+
for (let i = 0; i < n; i++) {
19+
DFS(L + 1, sum + arr[i]);
20+
}
2221
}
2322
}
2423
DFS(0, 0);

0 commit comments

Comments
 (0)